We have a function name as sorted() which you can use to sort the dictionary by value:
sorted(d.items(), key=lambda x: x)
This will sort the dictionary in ascending order.
To sort it in descending order just add reverse=True:
sorted(d.items(), key=lambda x: x, reverse=True)
To know more about this you can have a look at the following video tutorial:-