There are five vowel characters {a, e, i, o, u}. If the user given character input is one of them that means it is a vowel otherwise it is a consonant.

Logic

After taking input from the user, we have to check whether the given character is one of character available in the character sequence “aeiou” or not, using python in keyword. But before checking first we need to convert it to any one case either lower / upper so that the program can work with both the cases (Uppercase & Lowercase) characters.

Function lower()

Here the function lower() converts the character to lowercase type.

Keyword in

The in keyword can be used to check if the value is present in sequence (aeiou) or not.

Program

# Take input from user
ch = input("Enter a alphabet : ")[0]

# if given character is Lower case Vowel or Upper case Vowel
# then print vowel otherwise consonant
if ch.lower() in "aeiou":
    print("\n" + ch, "is a vowel.")
else :
    print("\n" + ch, "is a consonant.")

Output

Enter a alphabet : A
A is a vowel.