Q. Python program to check whether a character is vowel or consonant.

Here you will find an algorithm and program in Python programming language to check whether the given character is vowel or consonant.

Explanation : In English, five alphabets A, E, I, O, and U are called as Vowels. In English, all alphabets other than vowels are Consonant.

Algorithm to check whether a character is vowel or consonant

START
Step 1 - Input the alphabets.
Step 2 - Check if the alphabets is (a, e, i, o, u) if alphabet is among these then it is vowel.
Step 3 - If the alphabets is vowel than print Vowel otherwise print Consonant.
STOP


Python Program to Check Vowel or Consonant

ch = 'P'
if(ch == 'a' or ch == 'e' or ch == 'i' or ch == 'o' or ch == 'u' or ch == 'A'
or ch == 'E' or ch == 'I' or ch == 'O' or ch == 'U'):
  print(ch, "is a Vowel")
else:
  print(ch, "is a Consonant")

Output

P is a consonant.