Answer to Question #247425 in Python for Isabel Cortez

Question #247425

2. Phonics


Did you know that the first letters in the alphabet that a child learns are the vowels? Well, since they're the first letters that we learned as babies, then they must be easy to identify, right? So, let's make a code that will identify all vowels in a string and print out how many they are!


Let's go!


Input

A line containing a string.


CodeChum


Output

A line containing an integer.


3


1
Expert's answer
2021-10-06T04:04:19-0400

Source code


vowels=['a','e','i','o','u']
str1=input("Enter a string: ")
str2=str1.lower()
count=0
for i in str2:
    for v in vowels:
        if (i==v):
            count+=1
print(count)        
    


Sample Output





Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS