dic = {'a': 1, 'b': 3, 'c':2} dic = {k: v for k, v in sorted(dic.items(), key=lambda item: item[1])} print(dic) ==> {'a': 1, 'c': 2, 'b':3}
dic = {'a': 1, 'b': 3, 'c':2} dic = {k: v for k, v in sorted(dic.items(), key=lambda item: item[1])} print(dic) ==> {'a': 1, 'c': 2, 'b':3}