当前位置: 首页 > 工具软件 > Walden > 使用案例 >

统计Walden中单词出现的次数

柯锋
2023-12-01
import collections
f=open(r'C:\Users\86156\Desktop\Walden.txt','r')
str1=f.read().split(' ')   
m=collections.Counter(str1) #用于统计元素出现的次数
print(m
 类似资料: