Skip to main content

Vowel or Consonant in python | python solution |

 Vowel and Consonant Program in python


The alphabet is made up of 26 letters, 5 of which are vowels (a, e, i, o, u) and the rest of which are consonants. A vowel is a sound that is made by allowing breath to flow out of the mouth, without closing any part of the mouth or throat.

Input :

enter an alphabet D

Output :

D is a consonant

Program to print vowel or consonant in python.

#program to print vowel or consonant 
char = input("enter any alphabet ")
check = char.lower()
#char.lower() function converts char to lower letter
if (check=="a" or check=="e" or check=="i" or check=="o" or check=='u'):
    print(char," is vowel.")
else:
    print(char," is consonant.")

Output :

enter any alphabet D
D  is consonant.

Comments