Reading Time: 1 minutes
Vowels & Consonants in Python: A simple Python program to determine whether the entered letter is a vowel or a consonant.
Vowels & Consonants in Python
letter = input("Enter a letter: ")
if letter in 'aeiouAEIOU': # using the membership operator 'in'
print(letter, "is a vowel.")
else:
print(letter, "is a consonant.")
Try it here.







