6. is prime


I am having a similar problem.
My code

def is_prime(x):
    if x == 0 or x == 1:
        return False
    for n in range(2, x-1):
        if x% n == 0:
            return False
            return True


In your code you only look for 0 and 1 as none-prime numbers. But what happens if you put in -2?


and what if the number is 2? that will also not work.

Also, in the first run of your loop a return keyword is reached, which means your function ends, which happens in the first run of your loop. You should only return true after the loop has finished running


x - 1 is actually part of the excersise.