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 13 years
  • Last seen this week
Stats
1,006
reputation
98k
reached
10
answers
1
question
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

This user doesn’t have any gold badges yet.
11
silver badges
15
bronze badges
32
Score
2
Posts
18
Posts %
31
Score
1
Posts
9
Posts %
28
Score
2
Posts
18
Posts %
28
Score
2
Posts
18
Posts %
28
Score
1
Posts
9
Posts %
28
Score
1
Posts
9
Posts %
Top posts
View all questions and answers