<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
<In what way does your code behave incorrectly? Include ALL error messages.>
is_prime(3) reports false instead of true
<What do you expect to happen instead?>
The code is pretty straightforward, I don’t see the problem.
can anyone spot the error?
if x < 2: # 1 or less is automatically false
for num in range(2, x): # go through each number
if x % num == 0: # divisible by num, so not prime
<do not remove the three backticks above>