📅  最后修改于: 2022-03-11 14:46:12.784000             🧑  作者: Mango
with open('file1.txt','r+') as f:
numw=0
for line in f:
words= line.split()
print(words)
numw += len(words)
print(numw)