Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def primes(n):
- return [i for i in range(2, n + 1) if not [j for j in range(2, math.floor(math.sqrt(i) + 1)) if i % j == 0]]
- if __name__ == '__main__':
- print(primes(10))
Advertisement
Add Comment
Please, Sign In to add comment