One step too far
Take your time, follow the code and check your understanding.
The codeLoops
values = [1, 2, 3]
for i in range(len(values) + 1):
print(values[i])Your answer3 min · no timer
Show solution and explanation
Valid indices end at len(values) - 1. Use range(len(values)) or iterate over values directly.
The loop reaches an index outside the list.