I get the following error: Oops, try again. Your function fails on is_prime(5). It returns False when it should return True.
I expected it to say True but to me it looks like it ignores my if.
I know this is probably not the way it is meant te be but I still want to know what is going wrong here because to me it looks fine. I tried doing this a few other ways as well ( like using int() ) but I keep getting the same error.
Please tell me whats going wrong because its really annoying.
def is_prime(x): k = x / 2 l = x // 2 o = x / 3 p = x // 3 if x == 0 or x == 1: return False elif x == 2 or x == 3: return True elif k - l == 0: if o - p == 0: #Not Prime number return False return False elif k - l != 0 and o - p != 0: return True else: print 'you didn\'t type a number'