Python(jupyter) for prime numbers
<pre><code>primes=[]
for i in range(3,6):
    is_prime=True
    for j in range(2,i):
        if i%j ==0:
            is_prime=False
    if is_prime=True:
        primes= primes + [i]

primes
</code></pre>

<p>The code seems logical to me but I keep getting a syntax error at the 2nd last sentence <code>if is_prime=True</code>.</p>

<p><code>=</code> is the assignment operator. For equality checks, you should use the <code>==</code> operator:</p>

<pre><code>if is_prime == True:
</code></pre>

<p>Or better yet, since <code>is_prime</code> is a boolean expression in its own right, just evaluate it:</p>

<pre><code>if is_prime:
</code></pre>

python syntax-error