Knowee
Questions
Features
Study Tools

Adam, while helping his niece with her homework, needs to check if a given lowercase character is a vowel or consonant. Can you write a program to assist Adam in determining this? Input format :The input consists of a lowercase character.Output format :The output prints whether the given character is a vowel or consonant.Refer to the sample output for the exact text.Code constraints :The input should only be a lowercase character.Sample test cases :Input 1 :aOutput 1 :a is a vowelInput 2 :sOutput 2 :s is a consonant

Question

Adam, while helping his niece with her homework, needs to check if a given lowercase character is a vowel or consonant. Can you write a program to assist Adam in determining this? Input format :The input consists of a lowercase character.Output format :The output prints whether the given character is a vowel or consonant.Refer to the sample output for the exact text.Code constraints :The input should only be a lowercase character.Sample test cases :Input 1 :aOutput 1 :a is a vowelInput 2 :sOutput 2 :s is a consonant

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

Sure, here is a simple program that can help Adam determine if a given lowercase character is a vowel or a consonant.

# Python program to check if a character is vowel or consonant

# Function to check the input character
def check_character(char):
    # List of vowels
    vowels = ['a', 'e', 'i', 'o', 'u']

    # Check if the character is in the list of vowels
    if char in vowels:
        print(char, "is a vowel")
    else:
        print(char, "is a consonant")

# Test the function
check_character('a')  # Output: a is a vowel
check_character('s')  # Output: s is a consonant

This program defines a function check_character that takes a character as input. It then checks if this character is in the list of vowels. If it is, it prints that the character is a vowel. Otherwise, it prints that the character is a consonant.

This problem has been solved

Similar Questions

Take character as input from the console using input() function. Write a program to check whether the given input is a vowel or a consonant or a letter are not. Print the result to the console as shown in the examples.Sample Input and Output 1:ch: Aletter and vowelSample Input and Output 2:ch: Pletter and consonantSample Input and Output 3:ch: @not letter

Check whether the given character is a Vowel or ConsonantInput Format:Enter a Character as input  Output Format:Print the output as "Vowel" or "Consonant"  Constraints:0 <= letter <= 2^7Sample Input 1:tSample Output 1:Consonant

Write a C program to check whether an alphabet is vowel or consonant using switch case

Q) Write a program to input a string and convert it into uppercase and print the pair of vowels and number of pair of vowels occurring in the string. Example: Input: "BEAUTIFUL BEAUTIES " Output : Pair of vowels: EA, AU, EA, AU, IE No. of pair of vowels: 5

Define a class to accept a string and convert it into uppercase. Count and display thenumber of vowels in it.Input: roboticsOutput: ROBOTICSNumber of vowels: 3

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.