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
- Take an alphabet as input through the user.
- Create a list of vowels.
- Using an if-else statement check whether the input alphabet is in the list or not.
- 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
Python program to convert the month name to the number of days.
Python program to check whether a triangle is equilateral or not.
Python program to check whether a triangle is scalene or not.
Python program to check whether a triangle is isosceles or not.
Python program that reads month and returns season for that month.