This is my code:

def is_prime(x):

....n = 2

....if x < 2:

........return False

....elif x == 2:

........return True

....else:

........while n < x:

............result = x % n

............n = n + 1

............if result == 0:

................return False

............else:

................return True

It fails as "result == 0" returns False on the first iteration. How do I edit it to first check x with all the values of n and then return True or False.