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.


Expert's answer

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!

LATEST TUTORIALS
APPROVED BY CLIENTS