On Wed, Mar 4, 2015 at 8:53 PM, Phil <phil_...@bigpond.com> wrote: > phil@Asus:~/Python$ python3 > Python 3.4.2 (default, Oct 8 2014, 13:18:07) > [GCC 4.9.1] on linux > Type "help", "copyright", "credits" or "license" for more information. >>>> for row in xrange(0,12): > ... print(row) > ... > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > NameError: name 'xrange' is not defined
That looks like proper python 3 behavior, since xrange was replaced by range in python 3 (the old behavior of creating an actual list from range is now spelled list(range(0,12))). > Under IDLE 3: > > for row in xrange(0,12): > print('test ',row) > > xrange() is accepted but prints the following: > > ('test ', 0) > ('test ', 1) > ('test ', 2) > ('test ', 3) > ('test ', 4) Are you 100% positive that's the python 3 IDLE? Based on the output you show, that's python 2. -- Jerry _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor