On Tue, 22 Nov 2005 14:03:32 +0100, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote:
>"Shi Mu" wrote:
>
>>I use Python 2.3 to run the following code:
> a=[[1,2],[4,8],[0,3]]
> a.sort()
> a
>> [[0, 3], [1, 2], [4, 8]]
>
>> I wonder whether the sort function automatically consider the firs
"Shi Mu" wrote:
>I use Python 2.3 to run the following code:
a=[[1,2],[4,8],[0,3]]
a.sort()
a
> [[0, 3], [1, 2], [4, 8]]
> I wonder whether the sort function automatically consider the first
> element in the list of list as the sorting criteria or it just happens
> to be?
the
I use Python 2.3 to run the following code:
>>> a=[[1,2],[4,8],[0,3]]
>>> a.sort()
>>> a
[[0, 3], [1, 2], [4, 8]]
>>>
I wonder whether the sort function automatically consider the first
element in the list of list as the sorting criteria or it just happens
to be?
Thanks!
--
http://mail.python.org/