Write a Python program to count number of vowels in the given string

Write a Python program to count number of vowels in the given string

Program
def myfun(): 
    string=input("Enter string : ")
    vowels=0
    for i in string:
        if(i=='a' or i=='e' or i=='i' 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 : ",vowels)
            
if __name__=="__main__":
    myfun()


Output:

Enter string : Sateesh
Number of vowels are : 3



More Questions


22 . Write a Python program to count number of vowels in the given string
23 . Write a Python program to check whether a character is an alphabet or not
24 . Write a Python program to count number of digits in an integer
25 . Write a Python program to print fibonacci series
26 . Write a Python program to print reverse number
27 . Write a Python Program to print Palindrome numbers from 1 to 100
28 . Write a Python Program to find the factorial of a number using recursion
29 . Write a Python Program to check armstrong number of n digits
30 . Write a program to check armstrong numbers in certain interval
31 . Write a program to merging dictionaries
32 . Write a program to print swapping variables