from collections import Counter print(Counter("宝宝今年特别喜欢王宝强")) # 计数 lst = ["jay","jay","jay","宝宝","宝宝","胡辣汤","上官婉儿","上官婉儿"] c = Counter(lst) print(c.get("宝宝"))