Answer to Question #205309 in Python for Jeevansai Gandham

Question #205309

For example, if the given string is "Good Morning"

Vowels in the string "Good Morning" are "o, i" and their count is 4.

Remaining characters in the string are consonants their count is 7.

The First line of output is 4\nThe second line of output is 7.


1
Expert's answer
2021-06-10T05:27:28-0400
givenString=input()
vowels=0
consonants=0
givenString=givenString.lower()
for letter in givenString:
    if(letter == 'a' or letter == 'e' or letter == 'i' or letter == 'o' or letter == 'u' ):
        vowels+=1
    else:
        if letter != ' ' and letter.isdigit()==False:
            consonants+=1
print(str(vowels))
print(str(consonants))




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