Computer Science, asked by diljotsinghdhillon, 10 months ago

write a Python program to check whether the character is vowel or not​

Answers

Answered by charlie1505
7

Answer:

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")

Answered by Equestriadash
17

The following codes will have to be typed in script mode, saved and then executed.

Here, we'll be using the IF - ELSE function. It is a function that decides the result based on a given condition.

It will run the body of the code, only if the condition is true. Otherwise, the 'else' code of the value inputted will be executed.

CODE:

x = input("Enter a character:")

if x == "a" or x == "e" or x == "i" or x == "o" or x== "u" or x == "A" or x == "E" or x == "I" or x == "O" or x == "U":

   print("The character entered is a vowel.")

else:

   print("The character entered is a consonant.")

OUTPUT:

Attachments:
Similar questions