enumerate() is a built-in function in Python that allows you to have an automatic counter while looping over iterables.

Python enumerate() Function
The enumerate() function takes the following form:

enumerate(iterable, start=0)
The function accepts two arguments:

iterable - An object that supports iteration.
start - The number from which the counter starts. This argument is optional. By default, counter starts from 0.
enumerate() returns an enumerate object on which you can call the next() (or next() in Python 2) method to get a tuple containing a count and the current value of the iterable.

#python #python enumerate

Python Enumerate
4.00 GEEK