Source Code:
(back to article)
from collections.abc import MutableMapping original_dict = {'c': 3, 'a': 1, 'b': 2} sorted_dict = dict(sorted(original_dict.items())) print(sorted_dict)
Result:
Report an issue