array = [1, 2, 3, 4, 5]
for i in range(len(array)):
print(i, array[i])
array = [1, 2, 3, 4, 5]
for i, n in enumerate(array):
print(i, n)
Emitted when code that iterates with range
and len
is encountered. Such
code can be simplified by using the enumerate
builtin.