Module 4 · Manhattan Navigation
Lesson 3 · Lists — Knowledge ChecksAnswer key
Which is true about lists compared to tuples?
Lists use square brackets and are mutable, so they can grow — perfect for a path that's built up step by step.
Given path = [(0, 0), (1, 0), (2, 0)], what does path[2] return?
Indexing starts at 0, so path[2] is the third item: the tuple (2, 0).
For that same path, what does path[2][1] return?
path[2] is (2, 0); then [1] takes its column — 0. Two indexes: which step, then which part of that step.
A student's loop ends with a list holding only the LAST coordinate instead of all of them. What's wrong?
If append() isn't indented inside the loop, it runs a single time after the loop ends — capturing just the final value.