Write a Python program that analyzes the characters in a text file (text1.txt - included below *
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a Python program that analyzes the characters in a text file (text1.txt - included below*) and while also including at least one try-except error handling statement block, calculates the following:
- The number of words in the text file
- The number of uppercase letters in the text file
- The number of lowercase letters in the text file
- The number of digits in the text file
- The number of whitespace characters in the file
*The text file that needs to be read in this case - named text1.txt - includes the following information:
I'm Henery The Eighth, I Am! Henery The Eighth, I Am, I am! I got married to the widow next door, She's been married seven times before. And ev'ryone was a Henery, She wouldn't have Willie or a Sam. I'm her eighth old man named Henery, Henery the Eighth, I Am! Second verse same as the first! I'm Henery The Eighth, I Am! Henery The Eighth, I Am, I am! I got married to the widow next door, She's been married seven times before. And ev'ryone was a Henery, She wouldn't have Willie or a Sam. I'm her eighth old man named Henery, Henery the Eighth, I Am! H-E-N-E-R-Y Henery, Henery, Henery The Eighth, I AM. I am!
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: