Very basic, sorting a list ???

Ben Finney bignose+hates-spam at benfinney.id.au
Wed Nov 28 19:34:34 EST 2007


stef mientki <stef.mientki at gmail.com> writes:

> Here is the code
>    print 'xx1',type(ordered_list)
>    print 'xx2',ordered_list
>    print 'xx3',ordered_list.sort()
> 
> And this is the result
> xx1 <type 'list'>
> xx2 [14, 12, 10]
> xx3 None
> 
> What am I doing wrong ?

Apparently, ignoring the documentation of the functions you're using.
Have a look at how 'list.sort' is documented to work.

-- 
 \               "I was sleeping the other night, alone, thanks to the |
  `\                                    exterminator."  -- Emo Philips |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list