Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in Python 4. Write a function named initVowels that finds the words on each line of an input file that begin with a vowel and
in Python
4.
Write a function named initVowels that finds the words on each line of an input file that begin with a vowel and writes those words to a corresponding line of an output file. Each word in the output file should be followed by a space. The vowels are the letters a, e, i, o and u. The function initVowels takes two string parameters. 1) inFile is a string that is the name of an input file that exists before initVowels is called 2) outFile is a string that is the name of an output file that initVowels must create and write to. You may assume that inFile is in the current working directory and you should write outFile to that directory If a line in inFile is empty, initVowels should write a corresponding empty line to outFile. For example, suppose the following is the content of the file pay_me.txt: IfI'd been a rich man's son, Pay me my money down, I'd sit on the river and watch it run Then following function call: initVowelCount ( 'pay_me.txt, 'pay_me_vowels.txt') should produce this content in the file pay_me_vowels.txt: IfI'd a I'd on and itStep 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