Is Prime not working anymore


The code worked yesterday and I wanted to try different approaches today but it gives error today:

Oops, try again. Your function fails on is_prime(4). It returns True when it should return False.

What am I missing here?

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



if n % x == 0:

why n%x? we want to see if x is divisible by the different values of n (for loop)


Hah, thanks for your help (: