Kent Johnson | 13 May 14:25

Re: sorting dictionary keys?

On Tue, May 13, 2008 at 7:32 AM, Mugund K <k.mugund <at> yahoo.com> wrote:
>
> A quick but ugly [brain-dead :-) ]fix would be sorting keys seperately,

> >>> temp = d.keys()
> >>> temp.sort()
> >>> for i in temp:

Not so ugly; before sorted() was introduced (Python 2.4) that would be
the way to do it.

Kent
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor


Gmane