I am a python newbie and am attempting to write code for sieve of Eratosthenes. For this I have to initialize a list of empty sets. I tried doing this factors=[set()]*1001, but this produces a shallow copy. I want a deep copy, so that factors[i] and factors[j] point to different sets. Is there a simple syntax for doing that?
I am a python newbie and am attempting to write code for sieve of
Share
1 Answer