Answer to Question #319412 in Python for raju

Question #319412

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.


1
Expert's answer
2022-03-28T08:03:13-0400
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")

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