The error message given is:
Your function fails on is_prime(0). It returns None when it should return False.
Considering I have the raw_input turned into an integer for x and n starting at 2 and ending one number below the input I figure the code should return a True or False instead of none. I have the code break if the function comes back as false. I even have a print statement telling me whether the function returns true or false for each number I use as a raw input. What am I missing here?
x = int(raw_input("Please enter a number: ")) def is_prime(x): for n in range(2, x - 1): if x % n == 0: return False break else: return True print is_prime(x)
Again, printing the results comes back as true or false but for some reason I get the none error. Can anyone guide me towards where the issue is?