I have no idea why this code isn't working. The code prints out the expected output above 2, however below 2 it doesn't work, and i don't know why! I tried to put in an elif statement to sought out the problem but it didn't work and i don't know why. Any idea where i am going wrong?
def is_prime(x): for i in range(2,x): if x%i==0: return False break elif x<2: return False break else: return True