📜  python set with counts - Python 代码示例

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

代码示例1
>>> from collections import Counter
>>> mylist = ["Bob", "Mike", "Bob", "Mike", "Mike", "Mike", "Bob"]
>>> Counter(mylist)
Counter({'Mike': 4, 'Bob': 3})