Python Program to Check Vowels

« Previous Program Next Program »

Check Vowels in Python

To check whether the input character is a vowel or not in python, you have to ask from user to enter a character to check whether that character is a vowel or not as shown in the program given below.

Python Programming Code to Check Vowels

Following python program ask from user to enter any character to find whether it is a vowel or not:

# Python Program - Check Vowel or Not

print("Enter '0' for exit.");
ch = input("Enter any character: ");
if ch == '0':
    if(ch=='a' or ch=='A' or ch=='e' or ch=='E' or ch=='i' or ch=='I'
       or ch=='o' or ch=='O' or ch=='u' or ch=='U'):
    	    print(ch, "is a vowel.");
    	print(ch, "is not a vowel.");

Here is the sample run of the above Python program demonstrating how to check for vowel:

Initial output of the above program is given in the below screenshot, asking from user to enter any character to check it out:

check vowel python

Now type anything say e as input and press enter to check whether it is a vowel or not. As e is a vowel, therefore here is the output you will see:

check vowel or not python

Now let's re-run the above program, and check for not vowel just by entering any other character other than vowel, that is a, e, i, o, u.

python program check vowel

Here is the same program written and run directly on python shell:

python check vowel

Same Program in Other Languages

You may also like to learn or practice the same program in other popular programming languages:

« Previous Program Next Program »


Quick Links
Signup - Login - Give Online Test