Question: Write a function def countvowel(vord) that returns a count of all vowels in the string word vowels are the lettets a,e,i, 0 and and their
Write a function def countvowel(vord) that returns a count of all vowels in the string word vowels are the lettets a,e,i, 0 and and their uppercase variations, A, E, 1,0 and U - Createa count variable - Use a for loop to check eoch character (ch) in the string (word) - Inside the for logp, use an if statement to test if the character is in AEiou (youmioht want to change each character to , upper () bere: -.It there is a' vowel, herease the count - Return the count from the function Ex If word is: Wonderful: then the return volue from the function is: because thece is an ' , 'e, and 'y Ex. If wond iit: fventuay then the resurn value from the function in: becuuse there are 'e, is, and'a: You only need to write the function. Unit tests will access your function. Mo need for input 0 or print statements
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
