Sorted dictionary : Sort « Dictionary « Python Tutorial






dict2 = {'A':'1', 'B':'2' }
for eachKey in sorted(dict2):
     print 'dict2 key', eachKey, 'has value',
8.24.Sort
8.24.1.Sorted dictionary