首页 > 代码库 > Word frequency analysis

Word frequency analysis

Write a program that reads a file, breaks each line into words, scripts whitespace and punctuation from the words, and converts them to lowercase. Modify the program to print the 20 most frequently-used words in the book.

First I downloaded the e-book ‘ELSIE‘S WINTER TRIP’ in the below dictionary:

                       

 

Scripts:

 

 

 

from Thinking in Python