Can someone please look over my code. I get the correct responses but it tells me to switch to the opposite answer.
def is_prime(x): for n in range(int(x-1)): if x < 2: return False # not prime elif x % 2 == 0: # no remainders making it even return False # not prime else: return True print is_prime(0)
Oops, try again. Your function fails on is_prime(0). It returns True when it should return False.
Thank you very much.