Hey guys This code is showing an error message hat check the code for an infinite loop but when i call the function it works perfectly. Please help! def is_prime(x): n = 2 while n != x and n>=1: if x%n == 0: return False n += 1 else : return True Thanks
This line is the main problem I would suggest using a for loop for a more controlled output.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.