sort in the list

Shi Mu samrobertsmith at gmail.com
Tue Nov 22 12:56:44 CET 2005


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!



More information about the Python-list mailing list