Python Forum
sieve of eratosthenes implementation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sieve of eratosthenes implementation
#7
If iteratively is concern then from Python wiki code I read comment:

# This code iteratively builds up a chain
# of filters...

I actually don't see big difference between code in wiki and yours. Wiki one takes advantage of generators and don't build intermediate lists. Both use filters as this code is filter by any means:

[number for number in sequence if number % sequence[index] != 0 or number == sequence[index]]
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: sieve of eratosthenes implementation - by perfringo - Dec-23-2019, 06:50 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020