I can not get my loop to end
<p>I am trying to create a higher or lower game in python but can't get my loop to end. it just keeps going. My code looks like this</p>

<pre><code>a = 0
def ask(b, d, p):
    global a
    while a &lt; d:
        global question
        question = int(input())
        if question &lt; b:
            print"bigger"
        elif question &gt; b:
            print"smaller"
        else:
            print p
            break
        del question
        a += 1
        if  d1 == p1:
            print "wow. you lost. shame on you."
            time.sleep(3)
            quit()
</code></pre>

<p>if anybody can tell me what I did wrong that would be great.</p>

<p>Without knowing what the rest of the code is here is what I can offer.</p>

<p>In the code provided you have <code>d1 == p1</code> but they are never called or assigned in that area so they will never change. Therefore your loop can never progress because they variables inside it do not control it.</p>

<p>edit: I'm sorry you are correct @Evert. If <code>a</code> ever goes above what <code>d</code> is then it should end. So the loop should end eventually, but likely not when intended should they get it right. Should be <code>if question == answer</code>.</p>

python python-2.7