Module 4 · Manhattan Navigation
Lesson 4-1 · The Main Program — Knowledge ChecksAnswer key
The robot is 3 across and 1 up from the corner nearest you. Which line stores that?
x comes first: 3 across, then y: 1 up. Both numbers count from 0, so the corner itself is (0, 0).
How many lines does this print, and what is the last one?
STOPS = [(1, 1), (0, 2), (3, 3)] for stop in STOPS: print("Go to", stop)The loop runs once per item, and each item is a whole tuple. Three items, three lines, in list order.
A student calls drive_path(path, robot_position, robot_heading) on its own line, with nothing on the left, then plans the next leg. What goes wrong?
current_position inside drive_path() is the function's own variable. The main program only learns the new pose by assigning from the return: robot_position, robot_heading = drive_path(...).