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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started