Skip to main content
Module 1 · Learning to Drive

Lesson 4 · Parameters & Customization — Knowledge ChecksAnswer key

Correct answers are marked and the explanation follows each question.

  1. You click the gear on a function block and drag an 'input name' block into the 'inputs' block. What happens to the function definition?

    1. A.Nothing until you press Run
    2. B.It grows a "with:" row naming the new parameter
    3. C.The blocks inside the function are deleted
    4. D.A new function is created

    The definition block changes shape as soon as the input connects — that 'with:' row is the parameter list. Renaming the input renames what appears there.

  2. Inside the function body, where do you get a block that holds the parameter's value?

    1. A.The Variables category — the parameter appears there as a rounded block
    2. B.The Functions category, next to the call block
    3. C.You type its name into the number slot
    4. D.You have to make a new variable with the same name

    Adding a parameter creates a variable of the same name, and Blockly lists it under Variables. Drag that block into any slot inside the function where you want the value.

  3. In the call square (side_length: 50), what is the 50?

    1. A.The parameter
    2. B.The argument — the value passed in
    3. C.The function name
    4. D.The turn angle

    The parameter is the name (side_length) in the definition; the argument is the value (50) you pass when calling.

  4. With square (side_length), calling square (side_length: 35) makes the robot drive each side how long?

    1. A.90 cm
    2. B.35 cm
    3. C.4 cm
    4. D.It depends on the effort

    The argument 35 flows into the side_length parameter, so every Straight drives 35 cm.

  5. A function is defined as draw rectangle (length, width). Are draw rectangle (50, 30) and draw rectangle (30, 50) the same?

    1. A.Yes — the numbers are the same
    2. B.No — order matters, so length and width are swapped
    3. C.Yes — Blockly sorts them
    4. D.Only if the robot is turned off

    Arguments fill parameters in order. (50, 30) means length 50 / width 30; (30, 50) swaps them into a different rectangle.