Write a program that reads the text file's contents and calculates and outputs the following in this order: • The number of words in the file • The number of lines in the file • The number of uppercase letters in the file • The number of lowercase letters in the file • The number of digits in the file • The number of letter H's in the file • The number of whitespace characters in the file NOTE: Your program should include at least one try-except error handling statement block. Your program should also validate any input that could cause your program to crash. 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!
Write a program that reads the text file's contents and calculates and outputs the following in this order:
• The number of words in the file
• The number of lines in the file
• The number of uppercase letters in the file
• The number of lowercase letters in the file
• The number of digits in the file
• The number of letter H's in the file
• The number of whitespace characters in the file
NOTE: Your program should include at least one try-except error handling statement block. Your program should also validate any input that could cause your program to crash.
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!
Unlock instant AI solutions
Tap the button
to generate a solution







