Tech Study

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

Introduction

Write a Python program to check whether an alphabet is a vowel or consonant. 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

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

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

Python Examples

Introduction: Python Examples are the basic programming concepts of python like python syntax,python data types,,python operators,python if else,python comments etc.. …

Read more

C String Functions

C String Functions perform certain operations, It provides many useful string functions which can come into action. The <string.h> header …

Read more