Why does the code below return an empty string (''")? : <p>I don't understand when you input the word "pandemonium", how does it return an empty string (""). Can someone explain why that is. </p>

<pre><code>def mystery(text):
    result = ""
    for x in text:
        if x == "p":
            result += "pop"
        elif x == "m":
            result = ""
        else:
            result += x
    return result
</code></pre>
