seemingly simple list indexing problem

Ervan Ensis ervan.ensis at gmail.com
Mon Jul 28 17:24:43 EDT 2008


My programming skills are pretty rusty and I'm just learning Python so this
problem is giving me trouble.

I have a list like [108, 58, 68].  I want to return the sorted indices of
these items in the same order as the original list.  So I should return [2,
0, 1]

For a list that's already in order, I'll just return the indices, i.e. [56,
66, 76] should return [0, 1, 2]

Any help would be appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080728/377a4638/attachment.html>


More information about the Python-list mailing list