C2- Write a Python program that reads the contents of a file named ‘Book.txt’ (you must write exception handling if the file doesn’t exist)  The program should also determine and print the following:                           The number of words in the file  The number of distinct words (without repetition)  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 whitespace characters in the file

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter12: Exception Handling
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question

C2- Write a Python program that reads the contents of a file named ‘Book.txt’ (you must write exception handling if the file doesn’t exist) 

The program should also determine and print the following:                          

  1. The number of words in the file 
  2. The number of distinct words (without repetition) 
  3. The number of uppercase letters in the file
  4. The number of lowercase letters in the file 
  5. The number of digits in the file
  6. The number of whitespace characters in the file 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Exception Handling Keywords
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,