I need to find the first vowel of a string in python, and I'm a beginner. I'm instructed to move the characters before the first vowel to the end of the word and add '-ay'. For example "big" becomes "ig-bay" and "string" becomes "ing-stray" (piglatin, basically).
This is what I have so far:
def convert(s):
ssplit = s.split()
beginning = ""
for char in ssplit:
if char in ('a','e','i','o','u'):
end = ssplit[char:]
strend = str(end)
else:
beginning = beginning + char
return strend + "-" + beginning + "ay"
I need to find a way to stop the "if" statement from looking for further vowels after finding the first vowel - at least I think it's the problem. Thanks!