[Tutor] List comprehension question

Richard D. Moores rdmoores at gmail.com
Tue Nov 9 07:47:07 CET 2010


On Mon, Nov 8, 2010 at 21:31, Richard D. Moores <rdmoores at gmail.com> wrote:

> That sqrt(n) works for speeding up the finding of primes, but here we
> want to use int(n/2) (and why didn't I think of that?), which results
> in about a 2x speedup. See <http://tutoree7.pastebin.com/dyRC8vuX>.

NO! Use  int(n/2)+1 .  I'll correct that in
<http://tutoree7.pastebin.com/dyRC8vuX> and report back.

Dick


More information about the Tutor mailing list