is_prime


#1

def is_prime(x = int(raw_input("x = : "))):
    if x < 2:
        return False
    if x == 2:
        return True
    for n in range(2, x):
        if x % n == 0:
            return False
        else:
            return True

This is my code, whenever I try and run it its gives me the error that 9 returns True instead of False . I have no idea what is wrong and have played with it for a while now. Please help.


#2

enter you error message and url or name of course, this is cause of faster help to you
may this is. input_raw in function arguments

x = int(raw_input("x = : "))

i think this is additional because this accured in your loop

    if x == 2:
        return True