I want to step the loop iterator explicitly inside the loop. Is there a 'nicer' way to do this than:
idx = iter(range(0, 10))
for i in idx:
print i
if i == 5:
print "consuming %i in step %i" % (next(idx), i)
Edit: I wander if there is a way to get access to the loop-iterator other than defining it explicitly as in my example.
Thanks!