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>Although you're supposed to show your attempt at coding towards a solution and posting when you encounter a problem, you could do something like the following:</p>

<pre><code>a = 2363
b = 13
while True:
    try:
        c = int(input('Subtract {0} from {1}: '.format(b, a))
    except ValueError:
        print('Please enter an integer.')
        continue

    if a-b == c:
        a = a-b
    else:
        print('Incorrect. Restarting...')
        a = 2363
        # break
</code></pre>

<p>(use <code>raw_input</code> instead of <code>input</code> if you're using Python2)</p>

<p>This creates an infinite loop that will try to convert the input into an integer (or print a statement pleading for the correct input type), and then use logic to check if <code>a-b == c</code>. If so, we set the value of <code>a</code> to this new value <code>a-b</code>. Otherwise, we restart the loop. You can uncomment the <code>break</code> command if you don't want an infinite loop.</p>

python