Computer Science, asked by amanwriter353329, 6 months ago

.WAP to accept a character from the user and display whether it is a vowel or

consonant.​

Answers

Answered by valeriy69
6

\small\mathsf\color{pink}{using\: python\: 3}

import string

tmp_vowels = ["a", "e", "i", "o", "u"]

vowels = tmp_vowels[:]

for x in tmp_vowels:

vowels.append(x.upper())

alphabets = [*list(string.ascii_lowercase), *list(string.ascii_uppercase)]

consonants = [x for x in alphabets if x not in vowels]

c = input("character: ")

if c in vowels:

print("tis a vowel!")

if c in consonants:

print("tis a consonant!")

\small\mathsf\color{lightgreen}useful?\: \color{white}\mapsto\: \color{orange}brainliest

Similar questions