Activity: Refactoring in Action

CHECK FOR UNDERSTANDING: Take a look at the editor below. At the top of the program is a refactored version of the code you saw in the last activity. To refactor, we replaced the old code with a new version, but our program still does exactly the same thing. Our code now uses a function and a loop to be less repetitive.

  • Click Run and notice that the panther does the same thing as in the last activity.
  • Use the code in the editor below to answer the questions that appear on the stage.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
Support