I am newbie in Python.I'm making a word count program. Till now I made my program count all the words in a file, now I would like to count the frequency of words in a file.
I saw on stackoverflow a few examples but I'm not quite sure how to implement them to my code.
This is part of my code:
def read_file(filename):
with open(filename, 'r') as f:
return f.read()
def word_count(filename):
return len(read_file(filename).split())