I must be really overlooking something - I can't figure out why I'm getting this error, and it seems like I've tried many variations of my code.

I'm getting the error: "Your function fails on is_prime(3). It returns None when it should return True."

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 simply breaks

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


That helped! Thank you