If you really have a lot of lines of code inside your loops, where you do a lot of operations with the iteration variable, it might be a good idea to give it a unique, meaningful name, especially if different loops repeat on different types of objects,
In other cases, as in the example you specified, the iteration variable in different loops represents the same object and gives the same name, improving the readability of the code.
So, in general, you should find a way to make your code the most readable.
source share