Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Word Frequency

Directions

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 showing the number of times each word appears in that file, formatted like this:

     we | 7 *******
   each | 5 *****
     or | 5 *****
   need | 5 *****
   love | 5 *****
  about | 4 ****
 praise | 4 ****
   song | 4 ****
    day | 3 ***
    our | 3 ***

Starter Files

A starting program is located in word_frequency.py. There are also text files that you can use as your input files.

Resources

Bibliography

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages