Last active
August 29, 2015 14:18
-
-
Save srhopkins/e73d6cb5e98bb38c8e58 to your computer and use it in GitHub Desktop.
Is number prime?
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
# I often need a simple method to determine prime numbers. Returns True or False. | |
is_prime = lambda num: all((num % i > 0 for i in xrange(2,num))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment