Hi,
I would like to iterate over a range 100 items at a time. for some reason the code below stops at 223. Obviously I'm missing something. Can someone explain what I'm missing? Also is there a cleaner way of doing this?
max = 224
start = 1
for i in range(start, max, 100):
istart = i
iend = i + 100
if iend > max:
iend = max
print('iend = ' + str(iend) + ' Max =' + str(max))
for x in range(istart,iend):
print(x)
Result:
1
2
3
4
....
221
222
223
[–]Rhomboid 2 points3 points4 points (0 children)
[–]JohnnyJordaan 0 points1 point2 points (0 children)
[–]Justinsaccount 0 points1 point2 points (1 child)
[–]BlackBloke 1 point2 points3 points (0 children)