my code looks like this
def is_prime(x): if x<2: return False else: i=2 while i<=x: i=i+1 m=x/i if isinstance(m, int): return False break else: return True
i know that this is not the most elegant version, but i't like to understand why it isnt working. It fails already for x=2. If i wrote what i think i did, for the case x=3, m=x/i should be 3/4, which is not an integer. So why is my function returning False for is_prime(3)?
Thanks in advance