For an unknown reason, my is_prime() function returns True if called with 9 when it shouldn't. 9 is divisible by 3 and I think that 3 is in the range for n, but the system doesn't seem to find this.
Here is my code:
def is_prime(x): if x > 1: if x == 2 or x == 3: return True #If x is evenly divisible by n, it is not prime. #There may be a problem with iterating n. else: for n in range(2,x-1): if x % n == 0: return False else: return True else: return False
(I do think that my code is properly indented but this doesn't show up on my post.)