BeginnersBook

  • Home
  • Java
    • Java OOPs
    • Java Collections
    • Java Examples
  • C
    • C Examples
  • C++
    • C++ Examples
  • DBMS
  • Computer Network
  • Python
    • Python Examples
  • More…
    • jQuery
    • Kotlin
    • WordPress
    • SEO
    • JSON
    • JSP
    • JSTL
    • Servlet
    • MongoDB
    • XML
    • Perl

Python Program to Check Vowel or Consonant

Last Updated: January 3, 2018 by Chaitanya Singh | Filed Under: Python Examples

In this post, we will write a Python program to check whether the entered character is vowel or consonant.

Python Code

In this program, user is asked to input a character. The program checks whether the entered character is equal to the lowercase or uppercase vowels, if it is then the program prints a message saying that the character is a Vowel else it prints that the character is a Consonant.

# taking user input
ch = input("Enter a character: ")

if(ch=='A' or ch=='a' or ch=='E' or ch =='e' or ch=='I'
 or ch=='i' or ch=='O' or ch=='o' or ch=='U' or ch=='u'):
    print(ch, "is a Vowel")
else:
    print(ch, "is a Consonant")

Output:
Python Program Check Vowel Consonant

Related Posts:

  1. C Program to check Vowel or Consonant
  2. Java Program to check Vowel or Consonant
  3. Python program to check whether the character is Alphabet or not
  4. Python program to check if number is even or odd
  5. Python program to print Hello World

Top Related Articles:

  1. Python Program to Check If a number is Prime or not
  2. Python Program to Add Two Numbers
  3. Python Program to Check whether Year is a Leap Year or not
  4. Python Program to Check if a Number is Positive Negative or Zero
  5. Python Program to Convert Celsius To Fahrenheit and Vice Versa

About the Author

I have 15 years of experience in the IT industry, working with renowned multinational corporations. Additionally, I have dedicated over a decade to teaching, allowing me to refine my skills in delivering information in a simple and easily understandable manner.

– Chaitanya

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2012 – 2025 BeginnersBook . Privacy Policy . Sitemap