Answer to Question #217494 in Python for Bhargav

Question #217494

Write a program to count Vowels and Consonants in string.


1
Expert's answer
2021-07-15T01:53:42-0400
v = 0
c = 0
list1 = ['a','e', 'i', 'o', 'u']
list2 = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p','q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']
string = input('Enter string here:').lower()
for i in string:
    if i in list1:
        v += 1
    elif i in list2:
        c += 1
print(c)
print(v)

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