6
Write the vowel function that takes a single character as a parameter and return True if it is a vowel and False if it is a consonant.
Note that
vowel("a") must return True
vowel("b") must return False
vowel("E") must return True
The True and False values returned must be bool (boolean)
Tip: Remember that to pass a vowel as a parameter it needs to be a text, that is, it needs to be in quotes.
vogais = ("a", "e", "i", "o", "u")
letra = ("b", "c", "d", "f", "g", "h", "i", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z")
def vogal():
input(str("Digite uma letra: "))
while letra == vogais:
vogal = "a" or "e" or "i" or "o" or "u"
return "True"
else:
return "False"
There is no error in the code, but it is not in the right format, what I can do to make it simpler?
Thanks for the help
– Roberto