The passed letter is a vowel or consonant

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
  1. Take a string as input.
  2. Using For loop test whether the passed letter is a vowel or consonant.
  3. 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
				
			

count occurrences of a substring in a string.

Find the longest and smallest word in the input string.

Leave a Comment