Question: Easy Question #5 Create a function vowel_or_cons that takes in a letter of the alphabet. If the letter is a, e, i, o or u,

Easy Question #5

Create a function vowel_or_cons that takes in a letter of the alphabet. If the letter is a, e, i, o or u, then your function should return the string 'vowel'. If the letter is y then your function should return the string 'vowel or consonant'. Otherwise your function should return the string 'consonant'.

For example:

vowel_or_cons('a') # 'vowel'

vowel_or_cons('y') # 'vowel or consonant'

vowel_or_cons('h') # 'consonant'

what I have so far:

l = input('Input a letter: ') def vowel_or_cons(l): if l in ('a', 'e', 'i', 'o', 'u'): print('vowel') elif l == 'y': print('vowel or consonant') else: print('consonant') vowel_or_cons(l)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!