Exercise 3 · Chapter: ListsRequired+50 XP
Fix the Index
Oh no! This code is trying to print the last color in the list, but it's using the wrong index and will crash with an error.
Fix the code so it correctly prints "green", the last item in the list.
Hint: Remember that list indexes start at 0!
Need a hint?
3 available · costs 5 XP each
python
colors = ["red", "blue", "green"]
print(colors[3])
Output
Run your code to see the output here.