Skip to main content
Module 1 · Learning to Drive

Lesson 5 · The Polygon Function — Knowledge ChecksAnswer key

Correct answers are marked and the explanation follows each question.

  1. What turn angle will polygon compute for a 12-sided shape (a dodecagon)?

    1. A.12°
    2. B.30°
    3. C.36°
    4. D.90°

    The function calculates 360 ÷ 12 = 30° on its own — no need to work it out by hand.

  2. polygon (8, 25) traces an octagon about 2 m around. What does polygon (8, 50) do?

    1. A.A different shape
    2. B.The same octagon shape, but about twice as big (~4 m around)
    3. C.An octagon at double speed
    4. D.Nothing changes

    Doubling side_length doubles each side, so the perimeter doubles — but the angles (and therefore the shape) stay the same.

  3. Without a general polygon function, you'd write one function each for square, triangle, pentagon, hexagon, and octagon. With polygon, how many functions do you need?

    1. A.Five
    2. B.One
    3. C.One per shape you draw
    4. D.Three

    That's the power of generalizing: a single well-designed function replaces all the special-case ones.