I use Python 2.3 to run the following code:[color=blue][color=green][color=darkred]
>>> a=[[1,2],[4,8],[0,3]]
>>> a.sort()
>>> a[/color][/color][/color]
[[0, 3], [1, 2], [4, 8]][color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
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!
>>> a=[[1,2],[4,8],[0,3]]
>>> a.sort()
>>> a[/color][/color][/color]
[[0, 3], [1, 2], [4, 8]][color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
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!