Q. Write a program to count the number of each vowel in a given string.


Answer :-

s = input("Enter a string :-")
print("Number of a in string :-" , s.count("a") )
print("Number of e in string :-" , s.count("e") )
print("Number of i in string :-" , s.count("i") )
print("Number of o in string :-" , s.count("o") )
print("Number of u in string :-" , s.count("u") )

Output :-

Enter a string :-Path Walla
Number of a in string :- 3
Number of e in string :- 0
Number of i in string :- 0
Number of o in string :- 0
Number of u in string :- 0
>>>

Enter a string :-education
Number of a in string :- 1
Number of e in string :- 1
Number of i in string :- 1
Number of o in string :- 1
Number of u in string :- 1

>>>

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post