- To print whether an alphabet is Vowel or Consonant
User Input: z
Output: It's a consonant
c=input("Enter your character : ")
vowel=['a','e','i','o','u','A','E','I','O','U']
if (c in vowel) :
print("It's a vowel")
else :
print("It's a consonant")
Enter your character : E It's a vowelProgram
You should know first :
Vowel alphabets: a, e, i, o, u
Consonant alphabets: Alphabets other than vowels
#Declaring all vowels in a lists
vowel=['a','e','i','o','u','A','E','I','O','U']
#Check for vowels both in uppercase & lowercase
if (c in vowel) :
#if true print vowel
else :
#if false print consonant
OR
#Check for vowels both in uppercase & lowercase
if (c=='a' or c=='A' or c=='e' or c=='E' or c=='i' or c=='I' or c=='o' or c=='O' or c=='u' or c=='U') :
#if true print vowel
else :
#if false print consonant
Concept
Coming Soon !
QuickIn order to succeed you must fail, so that you know what not to do the next time.