The error message I get: Oops, try again. Your function fails on is_prime(9). It returns True when it should return False.
From all I understand so far, this should iterate trough a list of integers (to index of x, which is one less than x), use them to divide the x by, and report False as soon as modulo gives a zero (indicating that x is divisible by one of the n). I must be missing something. Please help.
def is_prime(x): x = abs(int(x)) if x < 2: return False elif x >= 2 and x <= 3: return True else: for n in range(2,x): while x % n != 0: return True else: return False