write a program to check whether a character is vowel or consonant in python 1

write a program to check whether a character is vowel or consonant in python

# taking user input
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")

Here is what the above code is Doing:
1. We are taking a character as input from the user.
2. Then we are checking if the character is equal to any of the vowels.
3. If the character is equal to any of the vowels, then it is a vowel.
4. If the character is not equal to any of the vowels, then it is a consonant.

Similar Posts