Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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 it

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_2

Step: 3

blur-text-image_3

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

Oracle Databases On The Web Learn To Create Web Pages That Interface With Database Engines

Authors: Robert Papaj, Donald Burleson

11th Edition

1576100995, 978-1576100998

More Books

Students also viewed these Databases questions