Question: Question : Code that needs to be modified: def count_vowel(Word): vowels='aeiou' count=0 Word=Word.lower() for i in range(len(Word)): if Word[i] in vowels: count+=1 return count def

Question : Question : Code that needs to be modified: def count_vowel(Word): vowels='aeiou' count=0

Code that needs to be modified:

def count_vowel(Word): vowels='aeiou' count=0 Word=Word.lower() for i in range(len(Word)): if Word[i] in vowels: count+=1

return count

def count_words_in(Sentence): Sen=Sentence.split() count=0 for i in Sen: if 3=2: count+=1 print(i) return count

phrase='There Are Many Beautiful Mangoes In Hawaii' print("There are",count_words_in(phrase),"words that meet the requirements in") print("'"+phrase+"'")

In class, on Thursday, we wrote a function, count_words_in(Sentence), that returns the number of words in Sentence that have between 3 and 7 letters and which contain at least 2 vowels, where vowels are taken to be the letters {'a','e','i','o','u'} lower case or upper case. Modify the function (or write your own) so that it does the same thing as the previous function except that y is also a vowel, but only if it is at the end of the word

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!