Skip to content

Enumerate

Python enumerate() function

Enumerate is a buil-in funciton in Python. Using this you can loop over a list (or any iterable) and at the same time you will have a counter telling you which round you are in.

So you will get outputs like 0a, 1b, 2c..

So, using enumerate, you get an index(trip counter) and item(item) in the list.

for
index, item
in
enumerate(sequence):