I have a dictionary
dict1={'18':['4000','1234'],'12':['7000','4821','187','1860','123','9000']}
I want to sort the keys and values such that, the output is,
dict1={'12':['123','187','1860','4821','7000','9000'],'18':['1234','4000']}
I tried something! but it didn work
>>> for values in dict1:
... dict1[values].sort()
...
>>> dict1
{'18': ['1234', '4000'], '12': ['123', '1860', '187', '4821', '7000', '9000']}
Full sorting happens for values of '18'. The values of '12' are partially sorted.
but '18' and '12' are themselves not sorted. I don't know whats happening!