sorted function python dictionary code example
Example 1: python get dictionary keys sorted by value
sorted(A, key=A.get)
Example 2: sort dictionary by key
dictionary_items = a_dictionary.items()
sorted_items = sorted(dictionary_items)
sorted(A, key=A.get)
dictionary_items = a_dictionary.items()
sorted_items = sorted(dictionary_items)