Skip to content

Instantly share code, notes, and snippets.

@ProProgrammer
Created September 25, 2013 14:23
Show Gist options
  • Save ProProgrammer/6700357 to your computer and use it in GitHub Desktop.
Save ProProgrammer/6700357 to your computer and use it in GitHub Desktop.
This function called takes a number as input and returns the boolean True if its is a prime number and False otherwise.
def is_prime(x):
if x < 2:
return False
for s in range(2,x):
if x % s == 0:
return False
else:
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment