sort by last then by first

Sean 'Shaleh' Perry shalehperry at attbi.com
Mon Jan 27 20:55:51 EST 2003


On Monday 27 January 2003 16:48, Brian Kranson wrote:
> is is possible to sort a list by one field and then by another field
> in the list.  for example....
>
> but what i don't know is if this will always work.  seems like the
> sort is what i am looking for, but i can't tell if it is by chance or
> if my logic is correct.
> i want to sort by last name then by first name.
>

the sort() method can be given a sorter function.  This function is defined in 
the reference docs and essentially acts like the C language strcmp().





More information about the Python-list mailing list