sness

blog of sness

Wednesday, October 24, 2012

How to sort a Python dict (dictionary) by keys or values « SaltyCrane Blog

How to sort a Python dict (dictionary) by keys or values « SaltyCrane Blog: "for key in sorted(mydict.iterkeys()):
print "%s: %s" % (key, mydict[key])"

'via Blog this'
sness at 10/24/2012 01:08:00 pm
‹
›
Home
View web version
Powered by Blogger.