Is prime?!?!?!


#1

`


#2

this worked for me-
I don't quite understand why you put the while function inside if function.

def is_prime(x):
if x<2:
return False
elif x==2:
return True
else:
for n in range(2,x):
if x%n==0:
return False
break
return True


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.