Write a simple looping program
<p>I want to write a program with this logic.</p>

<pre><code>A value is presented of the user.
Commence a loop
    Wait for user input
    If the user enters the displayed value less 13 then
       Display the value entered by the user and go to top of loop.
    Otherwise exit the loop
</code></pre>

<p>Your logic is correct, might want to look into <code>while loop</code>, and <code>input</code>. While loops keeps going until a condition is met:</p>

<pre><code>while (condition):
    # will keep doing something here until condition is met
</code></pre>

<p>Example of while loop:</p>

<pre><code>x = 10
while x &gt;= 0:
    x -= 1
    print(x)
</code></pre>

<p>This will print x until it hits 0 so the output would be 9 8 7 6 5 4 3 2 1 0 in new lines on console.</p>

<p><code>input</code> allows the user to enter stuff from console:</p>

<pre><code>x = input("Enter your answer: ")
</code></pre>

<p>This will prompt the user to "Enter your answer: " and store what ever value user enter into the variable x. (Variable meaning like a container or a box) </p>

<p>Put it all together and you get something like:</p>

<pre><code>a = 2363              #change to what you want to start with
b = 13                #change to minus from a

while a-b &gt; 0:        #keeps going until if a-b is a negative number
    print("%d - %d = ?" %(a, b))                      #asks the question
    user_input = int(input("Enter your answer: "))    #gets a user input and change it from string type to int type so we can compare it
    if (a-b) == user_input:         #compares the answer to our answer
        print("Correct answer!") 
        a -= b                      #changes a to be new value
    else:
        print("Wrong answer") 

print("All done!")
</code></pre>

<p>Now this program stops at <code>a = 7</code> because I don't know if you wanted to keep going with negative number. If you do just edited the condition of the while loop. I'm sure you can manage that. </p>

python