Difference between range and xrange ??

Joel Goldstick joel.goldstick at gmail.com
Mon Nov 5 15:42:48 CET 2012


in python 2.x xrange is a generator and range returns a list.  In python
3.x xrange is renamed to range replacing the list function with the
generator


On Mon, Nov 5, 2012 at 9:23 AM, inshu chauhan <insideshoes at gmail.com> wrote:

> what is the difference between range and xrange.. both seem to work the
> same. ? And which should be used where and in what situations.. ??
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>


-- 
Joel Goldstick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121105/33bf6d08/attachment.html>


More information about the Python-list mailing list