Loop construct in Python
<p>I'm a python noob and have issues setting up a loop that checks if an int z is divisible by a set of numbers, e.g. by 1 - 10. I wrote the following code snippets, but they all return X =[all the numbers of z]...  i.e. they fail to apply the if condition so that the mod is checked over all n in a given range/set.  </p>

<pre><code>X = []
z = 1
while z in range(1,1000):
    if all(z % n == 0 for n in range(1,21)):
        X.append(z) 
    z += 1
</code></pre>

<p>also tried: </p>

<pre><code>X = []
if all(i % n == 0 for n in range(1,21)):
    X.append(i)
</code></pre>

<p>and</p>

<pre><code>X = []
for z in range(1,1000000):
    if all(z % n == 0 for n in range(1,21)):
        X.append(z)  
</code></pre>

<p>Any idea what's going wrong in each of these (or at least 1) of these cases? 
Thanks for the help!</p>
