Module 4 · Manhattan Navigation
Lesson 4-7 · Tuples and Lists: What You Now Know — Knowledge Checks
Name Date
A program must remember every intersection where the robot found an obstacle, adding to it as the robot drives. What should it use?
Answer Why?
After these lines, what is total?
legs = [(2, 3), (1, 0)] total = 0 for leg in legs: x, y = leg total = total + x + yAnswer Why?
Given path = [(1, 0), (2, 0), (3, 0)], which line gives the y of the last position?
Answer Why?
What does scores hold after these three lines?
scores = [10, 20] backup = scores backup.append(30)
Answer Why?
A function is handed a list called blocked and runs blocked.append((2, 2)). After it returns, what does the caller's list hold?
Answer Why?