sorting a dictionary?

Anthony Liu antonyliu2002 at
Tue Mar 22 02:59:50 CET 2005

I have a dictionary which contains some words and
their frequency in a short novel.

It looks like this:

mydict = {'the':358, 'they':29, 'went':7, 'said':65}

Is there an easy to sort this dictionary and get a
list like the following (in decreasing order)?

the   358
said  65
they  29
went  7


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Python-list mailing list