Advertisements
Advertisements
प्रश्न
Write a Python function that displays all the words starting and ending with a vowel from a text file “Report.txt”. The consecutive words should be separated by a space in the output. For example, if the file contains:
Once there was a wise man in a village.
He was an awesome story-teller.
He was able to keep people anchored while listening to him.
Then the output should be:
Once a awesome able.
कोड लेखन
Advertisements
उत्तर
def votvowele():
f = open("Report.txt")
slst = f.readlines()
for line in slst:
wordlst = line.split(")
for w in wordlst:
if w[0] in "aeiouAEIOU" and w[-1] in "aeiouAEIOU":
print(w," ")
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
