Skip to main content
Module 1 · Learning to Drive

Lesson 1-12 · Python Final Project — Knowledge Checks

Name Date
  1. You're about to build a 60-block-worth Python program. What's the smartest way to start?

    1. A.Write the whole thing, then run it once at the end
    2. B.Write and test one small function at a time, then combine them
    3. C.Copy a classmate’s program
    4. D.Skip planning and improvise

    Answer Why?

  2. What is the difference between these two ways of describing a function?

    # Return the exterior angle
    def calculate_angle(sides):
        """Return the exterior angle."""
    1. A.The docstring is kept by Python and can be read back by tools like help(); the comment is discarded
    2. B.There is no difference — both are ignored by Python
    3. C.The comment is kept and the docstring is discarded
    4. D.Docstrings are only allowed at the top of a file

    Answer Why?

  3. Your program runs but the robot behaves differently each time on the same code. Most likely cause?

    1. A.A syntax error
    2. B.Physical factors — wheel slip, surface, or battery level
    3. C.The function names are wrong
    4. D.Python is broken

    Answer Why?