Question: PYTHON There's a beautifule poem called The Golden age which is shown below in red color. Save the red text to a .txt file called

PYTHON

There's a beautifule poem called "The Golden age" which is shown below in red color. Save the red text to a .txt file called GoldenAge.txt.

The Golden Age of Zen

Spring has its hundred flowers

Autumn its moon

Summer has its cooling breezes

Winter its snow

If you allow no idle concerns

To weight on your heart

Your whole life will be one

Perennial good season

Write a program that reads in the file, and breaks the text into words (strip the white spaces and new line characters). Convert all the words into lower case. Count total number of unique words (regardless of the cases) in the poem, and how many times a word is used.

From your program, print out in separate lines each word and the number of times it's used. A sample output may look like this:

this : 2

you : 3

[hint] Remember dictionary?

[Check point] submit your python code in .py file. Capture the screen of the running program and the output and submit as an image file.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!