I have a function isvowel that returns either True or False, depending on whether a character ch is a vowel.
def isvowel(ch):
if "aeiou".count(ch) >= 1:
return True
else:
return False
I want to know how to use that to get the index of the first occurrence of any vowel in a string. I want to be able to take the characters before the first vowel and add them end of the string. Of course, I can’t do s.find(isvowel) because isvowel gives a boolean response. I need a way to look at each character, find the first vowel, and give the index of that vowel.
How should I go about doing this?
1 Answer