Oops, try again. Your function fails on is_prime(2). It returns False when it should return True.
my code fails to check if 2 is prime or not.
I don't really follow what is n and what is x when python does the calculations. is n same as x as it is given in a range?
so e.g. for 3=x does that mean n is also 3?
Also why do the instructions tells us to do the range until x-1, if I put in x range formula already stops at x-1...
def is_prime(x): if x<2: return False else: for n in range(2,x): if x%n==0: return False else: return True