python统计列表元素出现次数_collections.Counter类统计列表元素出现次数
# 使用collections.Counter类统计列表元素出现次数from collections import Counternames = ["Stanley", "Lily", "Bob", "Well", "Peter", "Bob", "Well", "Peter", "Well", "Peter