[Tutor] Looping

W W srilyk at gmail.com
Mon Apr 20 19:50:56 CEST 2009


On Mon, Apr 20, 2009 at 12:34 PM, Matt
<HellZFury+Python at gmail.com<HellZFury%2BPython at gmail.com>
> wrote:

> Thank you. Func is in fact a call to an external non-python program. =]
> Therefore, the loop must actually be mindlessly done. My question, however,
> has been answered.
> As an aside, why use range rather than xrange? I was under the impression
> that xrange is a generator and therefore more memory efficient.
>

Probably because for small values (under 100), range just looks cleaner, and
as far as memory goes it's not a whole lot of difference.

AFAIK,
Wayne
-- 
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: every weakness,
every vice, has found its defenders, its rhetoric, its ennoblement and
exaltation, but stupidity hasn’t. - Primo Levi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090420/224280ce/attachment.htm>


More information about the Tutor mailing list