Question: Python 3. Write a function vowelCounts that accepts a single argument, a phrase consisting of words separated by spaces. The function then returns a list
Python
3. Write a function vowelCounts that accepts a single argument, a phrase consisting of words separated by spaces. The function then returns a list with the counts of the number of vowels that are present in each of the words in the phrase. For example, in the first example below, all the words have 2 vowels, except for them and DAY! which have only 1. The function then returns a list with a 2 for each word except for the above words, which have vowel counts of 1. Hint: dont worry about punctuation. >>> vowelCounts( 'Apples are healthy, you should eat them every DAY!') [2, 2, 2, 2, 2, 2, 1, 2, 1] >>> vowelCounts( "So long, see you LATER." ) [1, 1, 2, 2, 2] >>> vowelCounts( 'If it is raining, use an umbrella.') [1, 1, 1, 3, 2, 1, 3] >>>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
