Home / Python Tips Generated By ChatGPT / Using enumerate() for Counters in Loops in Python When looping through items and you need a counter, use enumerate() instead of manually managing a counter variable. Source Code for index, value in enumerate(["apple", "banana", "cherry"]): print(index, value)