PRACTICE / UNDERSTAND / REPEAT
Python practice question
Practice lists & slicing with self-contained questions. Check your answer, then use the explanation to understand the reasoning.
1 questionAnswers explainedFree · no login
Try this question
What does this Python code print?
values = [1, 2, 4]
print(values[-1])
Answer & explanation
Answer: 4
Index -1 selects the last element.