When the built in enumerate() function is called on a list, it returns an object that can be iterated over, returning a count and the value returned from the list.
for i, val in enumerate(array):
array[i] += 1
When the built in enumerate() function is called on a list, it returns an object that can be iterated over, returning a count and the value returned from the list.
for i, val in enumerate(array):
array[i] += 1