python-统计文件中单词出现的频率个数
def count_word(): count = {} with open('test.txt',) as f: lines = f.readlines() for line in lines: word = line.strip().split(' ')[0] print(word) if word in...