Why does my function stop working on the number 9? In looking at my function, when I go through and test the number 9 in the equations, it seems like it should work out and return False. But I receive this error message: "Oops, try again. Your function fails on is_prime(9). It returns True when it should return False."
The code works with other numbers (both prime and not prime) from 4 to 8. What's happening here?
if x <= 1: return False elif x == 2 or x == 3: return True else: for n in range (2, x-1): if x % n == 0: return False else: return True
Any help or advice is greatly appreciated.