标准库数出来是哪个词最多
运行下面这段程序:
from collections import Counter
print(Counter(["苹果", "香蕉", "苹果", "梨", "香蕉", "苹果"]).most_common(1)[0][0])
运行下面这段程序:
from collections import Counter
print(Counter(["苹果", "香蕉", "苹果", "梨", "香蕉", "苹果"]).most_common(1)[0][0])
全部评论