Exercise 8

Instead of using parallel lists, we will now use a dictionary. Read in all of alice.txt and compute the count for each word.

As before, print the frequency of the following words: “Alice”, “cassowary”, “roses”, “rabbit”, “mirror”.

If not doing anything fancy with punctuation and case (in other words, you are just splitting each line of the text on white spaces), you should get the following answers:

Frequency of Alice : 221

Frequency of cassowary : 0

Frequency of roses : 1

Frequency of rabbit : 1

Frequency of mirror : 0