Q:

Write a Python program to check whether an alphabet is a vowel or consonant

0

Write a Python program to check whether an alphabet is a vowel or consonant

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

I have used python 3.7 compiler for debugging purpose.

str = input("Input a letter of the alphabet: ")
 
if str in ('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U', 'A', 'E'):
    print("%s is a vowel." % str)
elif str == 'y':
    print("Sometimes letter y stand for vowel, sometimes stand for consonant.")
else:
    print("%s is a consonant." % str) 

Result:

Input a letter of the alphabet: A

A is a vowel.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write a Python program to convert month name to a ... >>
<< Write a Python program to check the validity of a ...