In this post, we will write a
Python program to check whether the entered character is vowel or consonant.
Python Code
In this program, user is asked to input a character. The program
checks whether the entered character is equal to the lowercase or
uppercase vowels, if it is then the program prints a message saying that
the
character is a Vowel else it prints that the
character is a Consonant.
# 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")
Output:
No comments:
Post a Comment
Your feedback is highly appreciated and will help us to improve our content.