My function is failing on 9 and so on.
I'm guessing that my loop is not functioning correctly, as in it only checks if it evenly divides for 2 and then stops.
Is this what is happening? and how can I fix my loop to check all for all the numbers in the range?
def is_prime(x): if x > 2: for n in range(2,x): if x % n == 0: return False break else: return True elif x == 2: return True else: return False