In this project, you will use open
to read in a text file and calculate the frequency of words in that file.
To calculate the frequency of words, you must:
- remove punctuation
- normalize all words to lowercase
- remove "stop words" -- words used so frequently they are ignored
- go through the file word by word and keep a count of how often each word is used
When your program is complete, you should be able to run python3 word_frequency.py praise_song_for_the_day.txt
and get a printed report like this:
we | 7 *******
each | 5 *****
or | 5 *****
need | 5 *****
love | 5 *****
about | 4 ****
praise | 4 ****
song | 4 ****
day | 3 ***
our | 3 ***
A starting program is located in word_frequency.py
.