Sorting a dictionary

Mikael Olofsson mikael at isy.liu.se
Wed Mar 15 08:39:31 CET 2000


On 13-Mar-00 Alex wrote:
 >  l = map (None, mydict.values (), mydict.keys ())
 >  l.sort ()
 >  l.reverse ()

What's wrong with 

l=mydict.items()

?

/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    15-Mar-00
Time:    08:31:01

This message was sent by XF-Mail.
-----------------------------------------------------------------------



More information about the Python-list mailing list