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

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more