On 01/11/11 14:33, Dave Angel wrote:
Just use the sort() method of the list object. In particular, items()
returns an unordered list, so it's ready to be sorted.
for residues, numbers in new_dictionary.items().sort():
I don't think this would work since sort works in place. You would need
to use sorted()
for residues, numbers in sorted(new_dictionary.items()):
And sorted() also works on the Set type object that items returns...
HTH,
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor