NameError / "name is not defined" in Python
<p>I am a beginner in Python and I receive this error message: <code>NameError: name 'z' is not defined</code>.</p>

<p>My code that causes the error:</p>

<pre><code>num = int(input("enter the max: "))
for i in range (2, num):
    is_prime = True
    for z in range (2, i):
        if i % z ==0:
            is_prime = False
    if is_prime:
     print(z)
</code></pre>