cs/practical-file/answers/question_11.py

11 lines
355 B
Python

# Question: Write a Python program to check whether a given character is a vowel or consonant.
char = input("Enter a character: ").lower()
if char.isalpha() and len(char) == 1:
if char in 'aeiou':
print(f"{char} is a vowel")
else:
print(f"{char} is a consonant")
else:
print("Please enter a valid single alphabet character.")