def prime_sieve(limit): prime = [True] * limit prime = prime = False for i, is_prime in enumerate(prime): if is_prime: yield i for n in xrange(i * i, limit, i): prime[n] = False
Member for 3 years, 3 months
10 profile views
Last seen 5 hours ago
Top network posts
- 53 String reversal in Python
- 47 Send a tweet to ISP when internet speed drops
- 45 Why is a `for` loop so much faster to count True values?
- 25 Comma Code (project from "Automate the Boring Stuff with Python")
- 22 Powerful GUI Calculator for Linux?
- 22 Count Even Digits In Number
- 21 Making a deck of cards in Python
- View more network posts →