Loop return to top question
<p>At <code>print("you dont have that many cards!")</code> i want the while loop to start over from</p>

<pre><code>print("how many cards in heap no:", n, end="")
</code></pre>

<p>instead of breaking. How can this be done?</p>

<pre><code>y = []
def cardHeaps():
    global cards
    n = 1
    while int(cards) &gt; 0:
        print("how many cards in heap no:", n, end="")
        x = int(input("? "))
        cards = int(cards)
        if x &gt; cards:
            print("you dont have that many cards!")
            break
        y.append(x)
        cards -= int(x)
        print(cards, " cards left")
        n += 1
        if cards &lt;= 0:
            print("out of cards!")
            break
</code></pre>
