Question: Question 13 (20 points) Write a function named initialVowels that analyzes the contents of a text file for words that begin with a vowel. The

 Question 13 (20 points) Write a function named initialVowels that analyzes

Question 13 (20 points) Write a function named initialVowels that analyzes the contents of a text file for words that begin with a vowel. The letters a, e, i, o and u are vowels. The function initialVowels should return a dictionary of vowel:word-list pairs. Each vowel should be a key in the dictionary if and only if it is the first letter of some word in the input file. The value of a key is a list of all the words in the input file in which that vowel is the first letter. (Hint: your job is easier if you lowercase the text in the input file.) Input. The function initialVowels takes a single parameter: inFile, a string that is the name of a text file. This file contains only upper and lower case letters and white space (no punctuation marks or other special characters). It is in the current working directory. i. Output. Return a vowel:word-list dictionary For example, if the file named catInTheHat.txt contains the same text as in Question 12, then the function call print (initialVowels('catInTheHat.txt')) should output f'i': l'it', 'in', 'i', 'i'. 'i'. 'a: ['all'and

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!