Question: This is an exception homework in Python: Define a function, most_vowels that calls file_reader to read a function and for each line, determine the string
This is an exception homework in Python:
Define a function, most_vowels that calls file_reader to read a function and for each line, determine the string that has the most vowels and output it to the screen, along with the line # it is located. If a line in the file is empty, output "line# is empty" where # is the number of the line. If multiple words on the file have the most amount of vowels, only the first one should be printed. If the file doesn't exist, only the error message from file_reader should be printed.
The function takes one parameter: input_file - a string representing the name of the file in the current working directory.
for example: >>> most_vowels("mary.txt") line1: little line2: fleece line3 is empty line4: everywhere line5: sure
>>> most_vowels("jillian.txt") This file does not exist. '''
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
