[Tutor] Working with lists - why does my script not work?
ALAN GAULD
alan.gauld at btinternet.com
Tue Jun 26 02:13:58 CEST 2012
CCing the list, please use replyAll when responding to the list.
By the way for some reason, the google class says that the functions sorted() is better than the method list.sort().
>
>
>
>" list.sort() -- sorts the list in place (does not return it). (The sorted() function shown below is preferred.) "
>
>http://code.google.com/edu/languages/google-python-class/lists.html
>
>
>Somebody knows why?
>
>No idea to be honest but it could be because in pure computer science theory
functions that return a value (ie sorted) are considered better than functions
that change things as a side effect (ie sort).
Alan Gauld
Author of the Learn To Program website
http://www.alan-g.me.uk/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120626/1a913e8e/attachment.html>
More information about the Tutor
mailing list