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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!