question number #176592 same quation but you are two test case pass but submission wrong ans
Special Characters
Write a program to count Vowels and Consonants in string.Input
The input will be a single line containing a string s.Output
The first line of output should contain no of Vowels in the given string
The second line of output should contain no of Consonants in the given stringExplanation
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.
vovels = 'AEIOU'
consonants = 'BCDFGJKLMNPQSTVXZHRWY'
inputStr = input()
vovelCnt, consCnt = 0, 0
for letter in inputStr.upper():
if letter in vovels:
vovelCnt += 1
elif letter in consonants:
consCnt += 1
print(vovelCnt,consCnt, sep="\n")
Comments
Leave a comment