📅  最后修改于: 2022-03-11 14:45:10.817000             🧑  作者: Mango
# Just use sorted()
from collections import Counter
counter = Counter({'A': 10, 'C': 5, 'H': 7})
counter.most_common()
>>>[('A', 10), ('H', 7), ('C', 5)]
sorted(counter.items())
>>>[('A', 10), ('C', 5), ('H', 7)]