Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python 3.6 Question 13 (20 points) Write a function named initialVowels that analyzes the contents of a text file for words that begin with a
Python 3.6
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 directorv i. Output, Return a vowel:word-list dictionarv 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 1 'it 1 1 1 all', 'and' ])Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started