Perl-Python-a-Day: Sorting

Xah Lee xah at xahlee.org
Thu Oct 13 02:51:05 EDT 2005


Lasse Vågsæther Karlsen wrote:

> Like the sorted function in Python ?
>
> li2 = sorted(li)
>
> you can also specify a key and a cmp function if you need to.

Thanks. I didn't know there's also a sort function in Python (2.4),
besides the method. (i've mentioned your name as acknowledgement at my
website essay)

The Python doc really should mention it at the place where the sort
method is documented.

 Xah
 xah at xahlee.orghttp://xahlee.org/




More information about the Python-list mailing list