Assuming that a text file named FIRST.TXT contains some text written into it, write a function named vowelwords(), that reads the file FIRST.TXT and creates a new file named SECOND.TXT, to contain only those words from the file FIRST.TXT which start with a lowercase vowel (i.e., with 'a', 'e', 'i', 'o', 'u'). For example, if the file FIRST.TXT contains Carry umbrella and overcoat when it rains Then the file SECOND.TXT shall contain umbrella and overcoat it.
Answers
Answered by
3
Answer:
def vowelwords():
f1=open("text1.txt")
f2=open("text2.txt",'w')
for line in f1:
line=line.split()
for word in line:
if word[0] in "aeiou":
f2.write(word+" ")
f2.write("\n")
f1.close()
f2.close()
Similar questions
World Languages,
5 hours ago
Social Sciences,
5 hours ago
Math,
5 hours ago
Biology,
9 hours ago
Social Sciences,
7 months ago
Math,
7 months ago