On Saturday 15 August 2009 03:25:45 Dr. Phillip M. Feldman wrote:

> It seems as though Python is actually expanding range(2,n) into a list of
> numbers, even though this is incredibly wasteful of memory. There should be
> a looping mechanism that generates the index variable values incrementally
> as they are needed.

There is.

Use xrange instead of range, and try again.

And while you are about it, you may as well teach them that it is much better 
to do a multiplication than a division.

-Hendrik

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to