I've tried various ways of messing with the code, but it keeps giving me 'Oops, try again. Your function fails on is_prime(0). It returns None when it should return False.', sometimes with it suceeding at is_prime(0), but failing at is_prime(1) or (9).
By what I understand, this should return True for is_prime(0), but it still gives the same error.
def is_prime(x): for n in range(2, x - 1): if x <= 2: return False elif x % n == 0: return False else: return True
I'm sure the solution I'm missing is very simple, but I can't get it. Thank you for your help.