def count_some_words(): f = open(“file","r",encoding='UTF-8') f1 = f.readline()
为什么怎样的话只读取了指定文件的第一行呢?
f1 = f.read()
试一下,有用的话请点采纳