Question: Write a Python program that does the following: Prompts you for a filename. You enter lipsum - project - 1 . txt Counts the number
Write a Python program that does the following:
Prompts you for a filename.
You enter lipsumprojecttxt
Counts the number of each word, excluding punctuation and disregarding case, and then displays each single word on a line with the number of instances of that word as follows:
Interface
system
broadband
Calculate the average length of all the words used in this lipsum, excluding punctuation, both as an integer and as a floatingpoint number.
Calculate the total word count of this lipsum.
If an invalid filename is entered, or the file cannot be read for any reason, the program must output a graceful error message.
If the filename entered does not have a txt extension, a graceful error message must appear that explains that.
All error messages must begin with the literal "ERROR
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
