I don’t understand the solution they have given:

def is_prime(x):

##if x < 2:

####return False

##else:

####for n in range(2, x-1):

######if x % n == 0:

########return False

####return True

For is_prime(2) it somehow gives True, yet 2 /2 =1, so 2 % 2 == 0, which should return False. What am I missing?

Also, in the range function why is it not range(2, x) as range functions don’t include the number after the comma? I assume no number divided by the previous number gives % == 0 (except possibly 2), but still it seems more certain to use x.