Python For Loop with Index: enumerate(), start and Pitfalls
To get the index in a Python for loop, wrap whatever you are looping over in enumerate(): It hands back the position and the item on every pass, so there is no counter to maintain and no square brackets to get wrong. Below: the start argument, what happens with dictionaries, and the bug that appears … Read more >>









