Skip to main content
Module 2 · Line Tracking

Lesson 2-4 · Random Turns — Knowledge ChecksAnswer key

Correct answers are marked and the explanation follows each question.

  1. What can `random.randint(1, 6)` return?

    1. A.Any decimal between 1 and 6
    2. B.Any whole number from 1 to 6, including 1 and 6✓
    3. C.The numbers 1 through 5 only
    4. D.Exactly six random numbers at once

    randint gives one integer, and the range is inclusive — so 1, 2, 3, 4, 5, or 6 (like rolling a die).

  2. Where do import statements belong?

    1. A.At the very top of the file✓
    2. B.Inside the while loop, so they run every pass
    3. C.Right before the robot moves
    4. D.Anywhere — it makes no difference

    By convention imports go at the top. You import once; the tools are then available everywhere below.

  3. Why does always turning exactly 180° cause a problem?

    1. A.It drains the battery faster
    2. B.The robot retraces the same path back and forth and never explores the rest✓
    3. C.180° turns are inaccurate on hardware
    4. D.It makes the robot leave the circle

    A 180° turn sends the robot straight back the way it came, so it bounces between the same two points forever. Random angles break that.