Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a file words.txt that contains a paragraph of random words (approximately 100 words long). Next, create a program that prompts for the file

image text in transcribed

Create a file words.txt that contains a paragraph of random words (approximately 100 words long). Next, create a program that prompts for the file name then iterates through each word in this file and counts the frequency of each letter (a through z) and stores the values in a dictionary. Make each letter lowercased and ignore punctuation. Print a histogram of the word counts. You may use "words.txt" included with this assignment. Hints: Python provides a module that stores various groups of characters as a string. If you import the string module, you will see that it contains a number of predefined strings, including: string.punctuation: '!"#$%&\'()*+,-./:; ?@[\\]^_`\{\}" || string.digits: '0123456789' string.ascii.lowercase: 'abcdefghijklmnopqrstuvwxxZ

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

More Books

Students also viewed these Programming questions

Question

Analyze financial reporting for intercorporate investments.

Answered: 1 week ago

Question

Analyze financial statement disclosures for investment securities.

Answered: 1 week ago