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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started