Mega Code Archive

 
Categories / Python Tutorial / Dictionary
 

Sorted dictionary

dict2 = {'A':'1', 'B':'2' } for eachKey in sorted(dict2):      print 'dict2 key', eachKey, 'has value',