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) (3

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) (3 marks) The program should also determine and print the following: (1 mark) a. The number of words in the file (2 marks) b. The number of distinct words (without repetition) (2 marks) C. The number of uppercase letters in the file (1 mark) d. The number of lowercase letters in the file (1 mark) e. The number of digits in the file (1 mark) f. The number of whitespace characters in the file (1 mark)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
