I have some trouble with this "prime" problem. Can you please explain why the is_prime(2) shows None with the code i wrote.Also can you tell me if there is a better way to write the code. I don't want to see other examples because I want to improve mine. Thank you and have a nice day.
def is_prime(x): if x<0: x=abs(x) if x>1: for n in range(2,x): if x%n==0: return False else: return True if x in range(0,2): return False