Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def isPrime(n):
- if n%2==0:
- return [False,2]
- if n<=1:
- return False
- half = n//2+1
- for i in xrange(3,half,2):
- if n%i==0:
- return [False,i]
- return True
- print isPrime(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement