I'm trying to order the values in a dictionary. Each value is a tuple of the form (element, [element,element...])
.
So if it looks like this:
{'5': (2, ['6']), '1': (3, ['4', '3']), '7': (3, ['9', '11', '12'])}
It should end up like this:
{'5': (2, ['6']), '1': (3, ['3', '4']), '7': (3, ['11', '12', '9'])}
The order is lexicographical string order, as you can see.
I tried to sort with a lambda but I cannot get to the list:
sortedDict = sorted(orderDict.values(),key=lambda x:x[0])