mirror of
https://github.com/Xevion/exercism.git
synced 2025-12-06 03:15:01 -06:00
7 lines
249 B
Python
7 lines
249 B
Python
def primes(limit):
|
|
v = [False] * 2 + [True] * (limit+1)
|
|
for (i, prime) in enumerate(v):
|
|
if prime:
|
|
for x in range(i * i, limit+1, i):
|
|
v[x] = False
|
|
return [x for x, y in enumerate(v) if y and x <= limit] |