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”)
elif(ch==’B’ or ch==’b’ or ch==’C’ or ch ==’c’ or ch==’D’
or ch==’d’ or ch==’F’ or ch==’f’ or ch==’G’ or ch==’g’ or ch==’H’ or ch==’h’ or ch==’J’ or ch ==’j’ or ch==’K’
or ch==’i’ or ch==’O’ or ch==’o’ or ch==’U’ or ch==’u’ or ch==’A’ or ch==’a’ or ch==’E’ or ch ==’e’ or ch==’I’
or ch==’L’ or ch==’l’ or ch==’M’ or ch==’m’ or ch==’N’ or ch==’n’ or ch==’P’ or ch==’p’ or ch ==’Q’ or ch==’Q’
or ch==’R’ or ch==’r’ or ch==’S’ or ch==’s’ or ch==’T’ or ch==’t’ or ch==’V’ or ch==’v’ or ch ==’W’ or ch==’w’
or ch==’X’ or ch==’x’ or ch==’Y’ or ch==’y’ or ch==’Z’ or ch==’z’):
print(ch, “is a Consonant”)
else:
print(“Invalid:”)
in this question i have create variable name ch it will store only character by user and it will also define what define in which situation called vowel, consonant and which one is invalid
i want the by user if he type A or E it will show vowel and B or C it will Show consonant and some times when user type numeric or symbols in will show invalid
Shiv Sharan Tripathi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.