def frenquence_statistic(file_name): frequence = {} for line in open(file_name,'r').readlines(): words =line.strip().split(" ") for word in words: word = ''.join(list(filter(str.isalpha,word))).lower() if frequence.get(word) == None : frequence[word] = 1 else : frequence[word] +=1 print (frequence)