Is prime


@stetim94 could you please help me? I get the same error message as @bitninja99561(Oops, try again. Your function fails on is_prime(3). It returns None when it should return True.)

Here is my code :

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


A function ends the moment a return keyword is reached, if a return keyword is reached in a loop, the loop breaks

You only want to return True after the for loop has finished running


Thank you so much, stetim94