iters on ints? (reducing the need for range/xrange)

Marcin 'Qrczak' Kowalczyk qrczak at
Sat Nov 10 00:51:58 CET 2001

09 Nov 2001 15:27:26 -0800, Paul Rubin <phr-n2001d at> pisze:

> The trouble is as someone else noted, "for i in 10" replaces "for i in
> range(10)".  But how do you handle range(1,10)?

By writing 'range(1,10)'.

Similarly as 'for x in dict' is a shortcut for 'for x in dict.iterkeys()'
and 'for x in dict.iteritems()' must be written explicitly.

 __("<  Marcin Kowalczyk * qrczak at

More information about the Python-list mailing list