How do I find the first occurrence of a vowel and move it behind the original word (pig latin)?
<p>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).</p>

<p>This is what I have so far:</p>

<pre><code>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"
</code></pre>

<p>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!</p>

<p>Python has the <code>break</code> and <code>continue</code>statements for loop control.  You can set a boolean that you trigger such that:  </p>

<pre><code>if flag:
    break
#do code
#set flag
</code></pre>

python findfirst