Question: Using PYTHON write a program that analyzes Charles Dickenss David Copperfield. Your program should scan the file copperfield.txt and provide per-chapter statistics for the total
Using PYTHON write a program that analyzes Charles Dickenss 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. In addition to these statistics, your program should report the longest and shortest word in each chapter. You should also create a list of all words used in the chapter. Sort the list alphabetically and report the first 10 words in the list. Finally, your application should create a dictionary that stores a count for each word appearing in the chapter. Use this dictionary to report the frequency of the longest word and shortest word. Also, report the most commonly occurring word in each chapter.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
