Hi I have a dictionary that is currently the one below:
dictionary={1:'a',2:'b',3:'c'}
my desired output is to have a dictionary with the highest keys to the left and the lowest keys to the right like below:
dictionary={3:'c',2:'b',1:'a'}
how do you do that in python 3.7?
>Solution :
dict(sorted(dictionary.items(), reverse=True))
This is duplicate of How do I sort a dictionary by key?