Question: python 3.xx Recursion Write a recursive function, containsVowel, which accepts one parameter containing a string value and returns True if the string contains a vowel.

python 3.xx

Recursion

Write a recursive function, containsVowel, which accepts one parameter containing a string value and returns True if the string contains a vowel. A string contains a vowel if:

*The first character of the string is a vowel or

*The rest of the string (beyond the first character) contains a vowel

this is what I have but it is not working

def containsVowel(s): if s[0] in "aeiouAEIOU": return True; elif s not in "aeiouAEIOU": return containsVowel (s[1:])

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!