Question: Python Homework 6 Write a program that analyzes Charles Dickens's David Copperfield. Your program should scan the file copperfield.txt and provide per-chapter statistics for the
Homework 6 Write a program that analyzes Charles Dickens's David Copperfield. Your program should scan the file copperfield.txt and provide per-chapter statistics for the total number of commas, total number of words and average word length Extra Credit Report the title of each chapter Hint Files are read line-by-line which means you'll need to manipulate the input a little bit to get it in a similar format to that of a paragraph from the previous homework. Once you've identified the start of a chapter, you can continue reading lines and appending them to a variable to recreate the chapter text in a single variable. You can then use this variable as if it were the variable containing the paragraph text. All chapters are identified in the format: CHAPTER XX.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
