📜  collections.Counter(string).most_common - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:18.184000             🧑  作者: Mango

代码示例7
counter = Counter({'Dog': 2, 'Cat': -1, 'Horse': 0})

# elements()
elements = counter.elements()  # doesn't return elements with count 0 or less
for value in elements:
    print(value)