Posted on 24th April 2024
Just look at this example.
ex_dictionary = {"z": 3, "x": 1, "y": 2}
dictionary_items = ex_dictionary.items()
sorted_items = sorted(dictionary_items)
print(sorted_items)
Output:
[('x', 1), ('y', 2), ('z', 3)]
STILL GOT QUERIES?