is_prime returns false when it should return false?


#1



I have re-arranged this every way to Sunday but I always get the error "fails on 0, returns false when it should return false"? I haven't noticed this in other posts so far.


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


#2

Hi. Remove quotation marks.


#3

Yeeeow! Thank you, frustration had begun to give way.......:smirk: