nvim-config/test.py

19 lines
336 B
Python
Raw Permalink Normal View History

2024-05-16 22:11:48 +00:00
def primes(n: int):
"""Return whether the number is prime for the first n primes."""
sieve = [True] * n
res = []
for i in range(2, n):
if sieve[i]:
res.append(i)
for j in range(i * i, n, i):
sieve[j] = False
return res
xs = primes(100)
ys = primes(200)
print(xs)