Posted By

magicrebirth on 05/17/10


sort dictionary

Versions (?)

sorting a dictionary

 / Published in: Python

Dictionaries cant be sorted, so you need to transform it into a list and sort that one!

  1. You could use:
  3. sorted(dictionaryObject.items(), key=lambda x: x[1] )

Report this snippet  

You need to login to post a comment.