In this Python program, we will learn how to check whether the entered character is a vowel or consonant.
Here is the source code of the program to check whether the entered character is a vowel or consonant.
# Python Program to Check Whether the Entered Character is Vowel or Consonant
# To take input from user
ch = input("Enter a character: ")
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")
else:
print(ch, "is a Consonant")
Enter a character: A
A is a Vowel
Enter a character: c
c is a Consonant
Comments