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
Get step-by-step solutions from verified subject matter experts
