Question: answer all the questions plz Consider the program below that counts the number of vowels in a string: VOWELS = ['a', 'e', 'i', 'o', 'u']
answer all the questions plz
Consider the program below that counts the number of vowels in a string: VOWELS = ['a', 'e', 'i', 'o', 'u'] def count(string): count = 0 for c in string: if c in VOWELS: count + = 1 return count print(count("How many vowels?")) What will be displayed when this program is executed? Rewrite the count function to use a while loop instead of a for loop. Write a class VowelCount that tracks the count for a given vowel. Make sure to define an_init_,_str_, and increase_count methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
