Module 1 · Learning to Drive
Lesson 3 · Introduction to Functions — Knowledge ChecksAnswer key
What's the difference between defining a function and calling it?
Defining is setup — it doesn't move the robot. The function only runs when you call it.
Your program calls square (a 4-sided loop) four times. How many sides does the robot drive in total?
Each call draws 4 sides, and you called it 4 times: 4 × 4 = 16.
You want bigger squares everywhere in your program. With a square function, how many places do you change the size?
That's the payoff of a function: fix or change it in one place, and every call updates automatically.