Skip to content

Instantly share code, notes, and snippets.

@dustinc
Created May 3, 2012 06:10
Show Gist options
  • Save dustinc/2583661 to your computer and use it in GitHub Desktop.
Save dustinc/2583661 to your computer and use it in GitHub Desktop.
def is_prime(n):
if n % 2 == 0:
return False
for i in range(3, n/2, 2):
if n % i == 0:
return False
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment