import collections
f=open(r'C:\Users\86156\Desktop\Walden.txt','r')
str1=f.read().split(' ')
m=collections.Counter(str1) #用于统计元素出现的次数
print(m)
import collections
f=open(r'C:\Users\86156\Desktop\Walden.txt','r')
str1=f.read().split(' ')
m=collections.Counter(str1) #用于统计元素出现的次数
print(m)