Python program that finds most frequent word in a .txt file, Must print word and its count

前端 未结 6 1446
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 23:29

As of right now, I have a function to replace the countChars function,

def countWords(lines):
  wordDict = {}
  for line in lines:
    wordList = lines.split         


        
6条回答
  •  太阳男子
    2020-12-08 00:13

    You have a simple typo, words where you want word.

    Edit: You appear to have edited the source. Please use copy and paste to get it right the first time.

    Edit 2: Apparently you're not the only one prone to typos. The real problem is that you have lines where you want line. I apologize for accusing you of editing the source.

提交回复
热议问题