Answer to Question #246287 in Python for Sai vignan

Question #246287
Write a program to count Vowels and Consonants in string.
1
Expert's answer
2021-10-04T23:10:21-0400
vowel = ['a','e','i','o','u']


string = input("Enter the string: ")
vowel_count = 0
con_count = 0


for i in range(len(string)):
    if string[i] in vowel:
        vowel_count += 1
    else:
        con_count = con_count + 1
print("Number of vowels: ", vowel_count)
print("Number of consonants: ", con_count)

 

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