In: Computer Science
Write a program In python of Jupiter notebook (using loops) that prompts the user to enter his/her favorite English saying, then counts the number of vowels in that (note that the user may type the saying using any combination of upper or lower case letters).
Example:
Enter your favorite English saying: Actions speak LOUDER than
words.
Number of wovels: 10
Python code:
#initializing vowels
vowels="aeiouAEIOU"
#asking for favorite English saying
saying=input("Enter your favorite English saying: ")
#initializing count as 0
count=0
#looping each charcter in saying
for i in saying:
#checking if it is a vowel
if(i in vowels):
#incrementing
count
count+=1
#printing Number of vovels
print("Number of vovels:",count)
Screenshot:
Input and Output: