Improve code readability with enumerate()
aleide opened this issue · 1 comments
aleide commented
The enumerate(iterator, start index) function gives you an iterator that returns both an index, starting at 'start index', and the regular output from 'iterator'. If 'iterator' has multiple return values they will be packaged as a tuple when using enumerate.
Example:
for index, item in zip(range(len(iter_object)), iter_object):
could be re-written as
for index, item in enumerate(iter_object):
hsaga commented
Can we close this issue?