Guest User

Untitled

a guest
Jan 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. def isprime(n):
  2. if n == 2:
  3. return 1
  4. if n % 2 == 0:
  5. return 0
  6.  
  7. max = n**0.5+1
  8. i = 3
  9.  
  10. while i <= max:
  11. if n % i == 0:
  12. return 0
  13. i+=2
  14.  
  15. return 1
Add Comment
Please, Sign In to add comment