I have a piece of code:
def is_prime(x):
if x >= 2:
for n in range(2,x):
if not ( x % n ):
return False
else:
return True
I am confused by the line if not ( x % n ):
I know % is module and gives the remainder.
I'm confused because I thought there had to be something for it to compare to like:
if x%n == y:
Can someone explain what exactly if not ( x % n ):
means?