So I've got this code down:
def is_prime(x): if x < 2: return False elif x == 2: return True else: for n in range(1, x-1): if x % n == 0: return False else: return True print is_prime
And, well, it works great to tell apart most of the prime numbers, I've tested it on the Python shell program I have, but........ 3 isn't popping up as a prime number, and the compiler's giving this error:
Oops, try again.
Your function fails on is_prime(3). It returns False when it should return True.
And I've been mulling on it for hours, but I still can't make heads or tails of what's throwing my program off. Probably some stupid mistake I am overseeing. Anyone care to help?