Skip to content

Instantly share code, notes, and snippets.

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