Infinite while loop reset when a function is run
<p>I was just wondering if I could remove some redundancy for a help function in a text-game. What I have right now is at the start of every function hint = 0, and hint is increased one every time an invalid answer is entered.</p>

<p>Here is what I have at the moment (inside every function):</p>

<pre><code>hint = 0
    valid = False
    while valid == False:

        print "Would you like to begin?"

        begin = raw_input("&gt; ")

        if "yes" in begin:
            valid = True
            print "Great!\n"
            start.start()
        elif "no" in begin:
            quit.quit()
        else:
            error.error(1)
            hint += 1

        if hint &gt; 4:
            print "\nYou may choose from \"yes\" and \"no\"."
</code></pre>
