Skip to content

Instantly share code, notes, and snippets.

@adarshk
Created March 26, 2015 19:22
Show Gist options
  • Save adarshk/e6bcb9c50192598c1dfd to your computer and use it in GitHub Desktop.
Save adarshk/e6bcb9c50192598c1dfd to your computer and use it in GitHub Desktop.
Prime num
def prime_function(N):
if N < 2:
return False
if N==2:
return True
if N%2 ==0:
return False
for i in range(2,N):
if(N % i) == 0:
return False
return True
p = prime_function(29) #test
print p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment