Skip to main content
Module 4 · Manhattan Navigation

Lesson 3 · Lists — Knowledge Checks

Name Date
  1. Which is true about lists compared to tuples?

    1. A.Lists use () and cannot change
    2. B.Lists use [] and CAN change (they are mutable)
    3. C.Lists and tuples are identical
    4. D.Lists can only hold numbers

    Answer Why?

  2. Given path = [(0, 0), (1, 0), (2, 0)], what does path[2] return?

    1. A.(1, 0)
    2. B.(2, 0)
    3. C.2
    4. D.An IndexError

    Answer Why?

  3. For that same path, what does path[2][1] return?

    1. A.2
    2. B.0
    3. C.(2, 0)
    4. D.An error

    Answer Why?

  4. A student's loop ends with a list holding only the LAST coordinate instead of all of them. What's wrong?

    1. A.append() is broken
    2. B.The append() line is outside the loop (wrong indentation), so it runs only once
    3. C.They used a tuple instead of a list
    4. D.range() is the wrong size

    Answer Why?