While-loop with an or-condition
<p>I want it to stop once one of the variables gets to the desired number. Why does this code wait until <strong>both</strong> variables equal 20 or greater to end? </p>

<pre><code>z = 20
x = 1
y = 0
while x &lt; z or y &lt; z:
    inp = int(input('enter a number'))
    if x &gt; y:
        y += inp
    elif y &gt; x:
        x += inp
    print(x, y)
</code></pre>

<p>or using something like these examples just keeps adding and never stops:</p>

<pre><code>while x != z or y != z:    
while x or y &lt; z:
while x or y != z:
</code></pre>