Created
December 31, 2016 18:16
-
-
Save Radcliffe/f858282dec716e3c431830523b1407eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def isprime(n): | |
"""Check if a number is prime, using trial division""" | |
return n>1 and all(n % d for d in range(2, int(n**.5) + 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment