Skip to main content
Share Your Experience: Take the 2024 Developer Survey
Graipher's user avatar
Graipher's user avatar
Graipher's user avatar
Graipher
  • Member for 8 years, 3 months
  • Last seen this week
Stats
40,956
reputation
2.0m
reached
774
answers
11
questions
Loading…
About
def prime_sieve(limit):
    prime = [True] * limit
    prime[0] = prime[1] = False

    for i, is_prime in enumerate(prime):
        if is_prime:
            yield i
            for n in range(i * i, limit, i):
                prime[n] = False

http://codereview.stackexchange.com/a/150447/98493

7
gold badges
69
silver badges
133
bronze badges
3,359
Score
780
Posts
99
Posts %
1,428
Score
314
Posts
40
Posts %
608
Score
131
Posts
17
Posts %
455
Score
107
Posts
14
Posts %
319
Score
77
Posts
10
Posts %
248
Score
44
Posts
6
Posts %
Top posts
View all questions and answers