>>> for x in xrange(5):
print x
0
1
2
3
4
Tip: You can substitute the range statement for the xrange statement. However, xrange will normally be more efficient than range, especially if you are iterating over a large range of numbers.
See also |