Question: PYTHON: Write a program that reads in a file containing words separated by spaces. Count the number of times the letter 'o' appears in all

PYTHON: Write a program that reads in a file containing words separated by spaces. Count the number of times the letter 'o' appears in all of the words, the number of words in the file, and find the longest word and the number of characters in that word. Display your results.

Sample output

There is a sample text file attached, that you can use to test your program. (words.txt)

Text file contents: Mookah Lakah Heekee Blah Belly Blah Mojo Nixon Skid Roper Lordy Lordy Lordy Misericordia Montefusco Melrose Queen Latifah Trailer Park Stuart Beelzebubba Fumanchu

Objectives: 1) Count the number of words in file, 2) count the number of times the letter 'o' appears in file, and 3) Identify longest word and count its letters.

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!