Is_prime: The Facts


#1



def is_prime(x):
prime = "yes"
if x == 0 or x == 1 or x < 0:
return False
for i in range(2,x-1):
if x % i == 0:
prime = "no"
if prime == "yes":
return True
else:
return False

**** I would just like to point out that 0 is a prime number and 1 is not a prime number.


#2

Neither 0 or 1 are primes.


#3

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