Last active
August 29, 2015 14:25
-
-
Save saleph/5bf341967c7cd61d2302 to your computer and use it in GitHub Desktop.
Simple prime numbers finder in 1 line.
This file contains 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
__author__ = 'tom' | |
import math | |
print([x for x in range(2, 1000) if not any([x % y == 0 for y in range(2, math.floor(math.sqrt(x))+1)])]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment