Help understanding the decisions *behind* python?
Tycho Andersen
tycho at tycho.ws
Mon Jul 20 12:43:16 EDT 2009
On Mon, Jul 20, 2009 at 11:27 AM, Phillip B
Oldham<phillip.oldham at gmail.com> wrote:
> <snip>
> We often find we need to do manipulations like the above without
> changing the order of the original list, and languages like JS allow
> this. We can't work out how to do this in python though, other than
> duplicating the list, sorting, reversing, then discarding.
>
I have no idea about why the design decisions were made. You might
take a look at the sorted() function:
http://docs.python.org/library/functions.html#sorted
It will do what you want.
\t
--
http://tycho.ws
More information about the Python-list
mailing list