Check vowel in python program by R4R Team

Example -

a,e,i,o,u and A,E,I,O,U these are the vowel in all alphabets.

program-

print("Enter Any character")
a=input()
if a.isalpha():
if a=='a' or a=='e' or a=='i' or a=='o' or a=='u' or a=='A' or a=='E' or a=='I' or a=='O' or a=='U':
print("Yes it is a vowel")
else:
print("It is not the vowel")
else:
print("It is not the alphabet")


output-

Enter Any character
a
Yes it is a vowel

Enter Any character
s
It is not the vowel

Enter Any character
2
It is not the alphabet


- In this program, we directly check the given input to vowels in if condition, the first if condition check that the input character is alphabet or not, if yes then check for vowel otherwise go in else part.

Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!