[Tutor] functions and iterations

xDog Walker thudfoo at gmail.com
Tue Nov 13 06:21:45 CET 2012


On Monday 2012 November 12 21:07, you wrote:
> I tried it with i == n as well and it still doesnt work :/

Check the documentation on range and xrange and you will find out why i never 
equals n.

>>> n = 5
>>> range(n)
[0, 1, 2, 3, 4]
>>> for i in xrange(n): print i
...
0
1
2
3
4
>>>
-- 
Yonder nor sorghum stenches shut ladle gulls stopper torque wet 
strainers.



More information about the Tutor mailing list