[PyAR2] Programming Challenge II - One is the Magic Number
srilyk at gmail.com
Tue Oct 28 13:53:57 CET 2008
On Tue, Oct 28, 2008 at 6:42 AM, <gslindstrom at gmail.com> wrote:
> It's much better to use xrange() -- as you did -- for things like this. If
> you use range(), Python will create a list and then traverse through it. In
> our case, it will make an array with 1,000,000 elements. xrange() creates
> generator which creates the values as they are used.
Heh... yeah, I know :D Plenty of discussion on the tutor list about that.
I'm not sure how long it takes one vs. the other, but I'm sure it's orders
But it's good to point out the difference for those who aren't familiar.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyAR2