You could use:
***sorted(d.items(), key=lambda x: x[1])***
This will sort the dictionary by the values of each entry within the dictionary from smallest to largest.
To sort it in descending order just add ***reverse=True:***
sorted(d.items(), key=lambda x: x[1], reverse=True)
Input:
***d = {'one':1,'three':3,'five':5,'two':2,'four':4}
a = sorted(d.items(), key=lambda x: x[1])
print(a)***
Output:
***[('one', 1), ('two', 2), ('three', 3), ('four', 4), ('five', 5)]***