Sorting a dictionary having keys as string of numbers in python

Posted by ben on Stack Overflow See other posts from Stack Overflow or by ben
Published on 2010-03-30T19:17:30Z Indexed on 2010/03/30 19:33 UTC
Read the original article Hit count: 279

Filed under:

I have a dictionary of the following form

a = {'100':12,'6':5,'88':3,'test':34, '67':7,'1':64 }

I want to sort this dictionary with respect to key as following

a = {'1':64,'6':5,'67':7,'88':3, '100':12,'test':34 }

Please help

© Stack Overflow or respective owner

Related posts about python