Program to check whether an alphabet is a consonant.

In this python if else program, we will check whether an alphabet is a consonant.

Consonant:  A consonant is a speech sound that is not a vowel. Consonants are all the non-vowel sounds

Steps to solve the program
  1. Take an alphabet as input through the user.
  2. Create a list of vowels.
  3. Using an if-else statement check whether the input alphabet is in the list or not.
  4. Print the output.
				
					char = input("Enter a character: ")
vowel = ["A","E","I","O","U","a","e","i","o","u"]

if char not in vowel:
    print("True")
else:
    print("False")
				
			

Output :

				
					Enter a character: B
True
				
			

Related Articles

check whether an alphabet is a vowel.

convert the month name to the number of days.

Leave a Comment