Another great utility when working with lists is the enumerate() function. When iterating over list elements, some operations might require the index of those elements. This can be done by iterating over a range(), but a more Pythonic way of doing it is using enumerate():
names = ['Bob', 'Anna', 'Lily']
for i in range(len(names)):
name = names[i]
print(f'Person {i}: {name}')
names = ['Bob', 'Anna', 'Lily']
for i, name in enumerate(names):
print(f'Person {i}: {name}')
enumerate() creates a tuple of index and value from each element of a list passed to it. The use of this kind of utility can distinguish good Python code from bad one.
Challenge
Given n numbers separated by a space, you are asked to print the sum of their index (starting from 0) and themselves for each number on a single line.