<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.>

is_prime

<In what way does your code behave incorrectly? Include ALL error messages.>

Why does prime 2 give a return value of “none”?

I know that removing the last else and placing the “return True” under the “for” will make this work, but I don’t understand why the else statement doesn’t catch prime 2?

<What do you expect to happen instead?>

def is_prime(x):

if x <= 0:

return False

elif x == 1:

return False

elif x > 1:

for n in range(2, x):

if x % n == 0:

return False

else:

return True

`<do not remove the three backticks above>`