Question: Create a program in python that reads a file and outputs a list of words and the number of times they show up in the

Create a program in python that reads a file and outputs a list of words and the number of times they show up in the file. The following is the sample user diaglog that your Python program should implement.

Example

What is the name of the file?

what do you want it to do?

A - Show the list of words and associated word counts in alphabetical order

B - Show the list of words/word counts sorted by word count

C - Quit

considerations

1)Convert all words to lowercase, so 'The' and 'the' both map to 'the.'

2) If you use .split(' ') to split apar a setence by white space, make sure to drop any leading & trailing punctuations so 'Alice.' and 'Alice,' are counted as 'alice'

txt file https://drive.google.com/file/d/0ByrUPBl1cu8ZTDFRT0VDa0p5ZlU/view

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!