In this program, we will take a string as input and test whether a passed letter is a vowel or consonant
Steps to solve the program
- Take a string as input.
- Using For loop test whether the passed letter is a vowel or consonant.
- Print the output.
#Input letter
letter = "aerv"
#Printing output
for char in letter:
if char == "a" or char =="e" or char =="i"
or char =="o" or char =="u":
print(f"{char} is vowel")
else:
print(f"{char} is consonant")
Output:
a is vowel
e is vowel
r is consonant
v is consonant