On Sat, 21 Jul 2012 20:40:46 +0100, MRAB wrote:

> On 21/07/2012 20:08, Lipska the Kat wrote:
>>      l=sorted(l, key=itemgetter(0))
>
> Short is:
> 
>      l.sort(key=itemgetter(0))

Shorter, and the semantics are subtly different.

The sorted function returns a copy of the input list.

The list.sort method sorts the list in place.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to