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.
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))
Comments
Leave a comment