I have dictionary of lists that I need to sort by the first value in the list. I'm using a defaultdict.
from collections import defaultdict
Dict = defaultdict(list)
Dict['A'].append([100, 'abcd'])
Dict['A'].append([50, 'bgfd'])
Dict['A'].append([150, 'abcd'])
I need to iterate over the dictionary in an ordered manner so that I get:
for Entry in Dict['A']:
print Entry
Should give:
[50, 'bgfd']
[100, 'abcd']
[150, 'abcd']