Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems On GPUs In Databases

Authors: Johns Paul ,Shengliang Lu ,Bingsheng He

1st Edition

1680838482, 978-1680838480

More Books

Students also viewed these Databases questions