PEP 276 Simple Iterator for ints

James_Althoff at i2.com James_Althoff at i2.com
Wed Nov 28 22:31:24 CET 2001


Lulu wrote:
>  >>> if i in 100:  print 'even Natural' # I have no idea what this MEANS!

Small point, but it would just mean the same as:

  >>> if i in xrange(100):

as in, e.g.,

>>> i = 2
>>> if i in xrange(100):
...     print 'spam'
...
spam
>>>

You just wouldn't have to read or write the xrange thing. :-)

Jim





More information about the Python-list mailing list