WARNING: This program has a bug, which means that we need to debug it!

RULE: Any command that will be repeated in the loop needs to be indented underneath the first line of the loop.

An indent is 4 spaces, or 1 tab.

  • Click Run and read the error message.
  • Debug the program so that the butterfly zigzags across the stage

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_background("park") sprite = codesters.Sprite("butterfly") sprite.go_to(-150, -150) sprite.pen_down() angle = 125 for counter in range(4): sprite.move_forward(75) sprite.turn_left(angle) sprite.move_forward(75) sprite.turn_right(angle)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)