Python - Prime Number exercise
<p>Note, this is not my homework assignment! I'm just trying to understand Python (and math, sadly) at the same time. I know the ultimate goal of this program is to get a list of prime numbers in the range 1 to 20, however, once it gets to the "for x in range..." line, I'm getting lost and the tutorial doesn't explain it in detail. </p>

<p>Could you please explain in plain English step by step and clarify specifically</p>

<p>a) what is x in the line <code>for x in range (2,n)</code></p>

<p>b) in the line <code>for x in range (2,n),</code> what is <code>n</code>? Is it the same "n" at the bottom?</p>

<p>c) what is this <code>n, x, n // x</code> saying exactly. Please clarify the <code>//</code></p>

<p>thanks if you can help</p>

<pre><code>def isprime(n):
    if n == 1:
        print("1 is special")
        return False
    for x in range(2, n):
        if n % x == 0:
            print("{} equals {} x {}".format(n, x, n // x))
            return False
    else:
        print(n, "is a prime number")
        return True

for n in range(1, 20):
    isprime(n)
</code></pre>
