import collections
f=open(r'C:\\Users\\21033\\Desktop\\Walden.txt','r')
a = f.read().split()#分隔开每个单词
print(collections.Counter(a))#统计计算
Walden单词词频统计任务
最新推荐文章于 2020-11-19 11:52:49 发布
import collections
f=open(r'C:\\Users\\21033\\Desktop\\Walden.txt','r')
a = f.read().split()#分隔开每个单词
print(collections.Counter(a))#统计计算