Question: ( write the whole python solution ) . You are given the task to create a Python program that can analyze a paragraph of text

(write the whole python solution). You are given the task to create a Python program that can analyze a paragraph of text stored in a text file.
The program should start by asking the name of the file to analyze. The file should be located in the same folder as the program. Once the file has been opened, your program should read every line and produce the following statistics:
Total count of characters inside the file.
Total count of the number of lines in the file.
Average of characters per line.
Total count of uppercase letters (you can use the .upper method in a comparison).
Total count of spaces
Once done, the program should write these five statistics in a new data file, starting each line with the name of the statistic followed by its value (don't forget the space)
For the input data, any text file can work. You can use the provided files for testing. -text_file_1.txt: This is a randomly generated sentence.
Teamwork makes the dream work.
She sells seashells by the seashore.
Creativity is key to innovation.
Exploring the unknown can be exciting.
A watched pot never boils.
Python is a versatile programming language.
Artificial intelligence is transforming the world. - Text_file_2.txt:Exploring the unknown can be exciting.
A watched pot never boils.
The grass is always greener on the other side.
She sells seashells by the seashore.
A quick brown fox jumps over the lazy dog.
The early bird catches the worm. - text_file_3.txt: Creativity is key to innovation.
A watched pot never boils.
Exploring the unknown can be exciting.
Artificial intelligence is transforming the world.
The grass is always greener on the other side.
Python is a versatile programming language.
She sells seashells by the seashore.
The early bird catches the worm.
Every journey begins with a single step.
This is a randomly generated sentence.
The sky is clear and blue today.
Consistency is the hallmark of excellence.
A quick brown fox jumps over the lazy dog.
Teamwork makes the dream work. - text_file_4.txt: Necessity is the mother of invention.
A picture is worth a thousand words.
All that glitters is not gold.
To be or not to be, that is the question.
A watched pot never boils.
The early bird catches the worm.
She sells seashells by the seashore.
Absence makes the heart grow fonder.
The pen is mightier than the sword.
When in Rome, do as the Romans do.
Actions speak louder than words.
Better late than never. - text_file_5.txt: All that glitters is not gold.
A picture is worth a thousand words.
Necessity is the mother of invention.
To be or not to be, that is the question.
She sells seashells by the seashore.
A penny saved is a penny earned.
A journey of a thousand miles begins with a single step.
A watched pot never boils.
Absence makes the heart grow fonder.
How much wood would a woodchuck chuck if a woodchuck could chuck wood?
Beauty is in the eye of the beholder.
Better late than never.
The early bird catches the worm.
You can't judge a book by its cover. - text_file_6.txt: The pen is mightier than the sword.
A picture is worth a thousand words.
A penny saved is a penny earned.
Birds of a feather flock together.
Better late than never.
Beauty is in the eye of the beholder.
When in Rome, do as the Romans do.
Actions speak louder than words.
A watched pot never boils.
To be or not to be, that is the question.
The quick brown fox jumps over the lazy dog.
She sells seashells by the seashore.
Absence makes the heart grow fonder.
Necessity is the mother of invention.

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 Programming Questions!