No, you give him a name: for i in range(10): ...
If you want to iterate over the elements of a collection in such a way as to get both the element and its index, Pythonic's way of doing it is for i,v in enumerate(l): print i,v(where lis a list or any other object that implements the sequence protocol.)
source
share