Skip to content

Instantly share code, notes, and snippets.

@saleph
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saleph/5bf341967c7cd61d2302 to your computer and use it in GitHub Desktop.
Save saleph/5bf341967c7cd61d2302 to your computer and use it in GitHub Desktop.
Simple prime numbers finder in 1 line.
__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