my_dict = {"a": 10, "b": 5, "c": 20} sorted_dict = dict(sorted(my_dict.items(), key=lambda item: item[1])) print(sorted_dict)