Dave Angel wrote: [snip]
It would probably save some time to not bother storing the zeroes in the list at all. And it should help if you were to step through a list of primes, rather than trying every possible int. Or at least constrain yourself to odd numbers (after the initial case of 2).
Or stop looking for more factors when you've passed the square root of num. I don't know what effect there'll be on the time if you recalculate the square root when num changes (expensive calculation vs smaller search space). -- http://mail.python.org/mailman/listinfo/python-list