Skip to content

Instantly share code, notes, and snippets.

@computer-tutor
Created April 24, 2020 07:32
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Chapter 6] Q1
def prime(n, i=2):
if(n<=2):
return True if(n==2) else False
if(n%i==0):
return False
if(i*i>n):
return True
return prime(n,i+1)
print(prime(15))
print(prime(25))
print(prime(23))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment