
| The Following User Says Thank You to shapeshifter For This Useful Post: | ||
| The Following User Says Thank You to shapeshifter For This Useful Post: | ||
def is_prime(self, n):
'''check if integer n is a prime'''
for x in range(2, int(n**0.5)+1):
if n % x == 0:
return False
return True
def is_prime(self, n):
'''check if integer n is a prime'''
if n == 2:
return True
for x in range(2, int(n**0.5)+1):
if n % x == 0:
return False
return True