HI all! I'm stuck on is_prime and was wondering if I could get some help.
I'm getting an infinite loop on the practice window yet the code works when I just run it on my Mac.
Running this in terminal gives me the correct answer every time. Running it on codecademy, not so much. Am I missing an infinite loop? Thanks!!
def is_prime(x): if x == 1: return False elif x == 2: return True else: n = 2 while n != x: if x % n == 0: return False break elif n + 1 == x: return True break else: n += 1 number = raw_input("Give me a number and let\'s see if it's a prime number: ") number = int(number) print is_prime(number)