Example 5: Write a program to count and print number of vowels in
a string.
# Take the input string form the user
String=input(“Enter string:”)
vowels=0
For i in string:
if(i== ‘a’ or i== ‘e’ or i== ‘o’ or i== ‘u’ or i==‘A’ or i== ‘E’ or i== ‘I’ or i== ‘’O or i== ‘U’):
Vowels=vowels+1
Print (“number of vowels are:”)
Print (vowels)
OUTPUT:
Enter string: Amsterdam
Number of vowels are:
3