Sort a dictionary in python

0

My question is that I want to sort the elements of a dictionary alphabetically and I do not know how to do it.
My dictionary gives me:
_init 4
other 6
hello 8
hello 12

And I want you to give me:
_init 4
hello 8
hello 12
other 6

Thanks!

    
asked by H4LLORENTE 05.04.2018 в 14:29
source

1 answer

0

Use the Sorted function (name of the VariableDelivery, reverse = True / False) the reverse parameter is optional.

    
answered by 06.04.2018 в 08:27