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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started