Question: Write a function def countVowel (word) that returns a count of all vowels in the string word. Vowels are the letters a, e, i,

Write a function def countVowel (word) that returns a count of all

Write a function def countVowel (word) that returns a count of all vowels in the string word. Vowels are the letters a, e, i, o, and u and their uppercase variations, A, E, I, O, and U. Create a count variable Use a for loop to check each character (ch) in the string (word) Inside the for loop, use an if statement to test if the character is in 'AEIOU' (you might want to change each character to .upper () here. o If there is a vowel, increase the count . Return the count from the function Ex: If word is: Wonderful then the return value from the function is: 3 because there is an 'o', 'e', and 'u'. Ex: If word is: Eventually then the return value from the function is: 4 because there are 'e', 'u', and 'a'. You only need to write the function. Unit tests will access your function. 453038.3110466.qx3zqy7 LAB ACTIVITY 5.3.1: LAB: Function to count vowels 0/10

Step by Step Solution

3.46 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Certainly heres a Python function that counts the vowels in a given word ... View full answer

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 Programming Questions!