Challenge 5: Debug the program so that the diver jumps and toothy moves right.

  • Click Run and press the space bar to read the error message.
  • Click Stop, then debug the program. Click Run and press the space bar again to check your work.

Hint: We need to use the sprite's name in front of any command that we want that sprite to do.

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

stage.set_background("underwater") diver = codesters.Sprite("scubadiver1", 100, -100) toothy = codesters.Sprite("shark", -200, -200) def space_bar(): sprite.jump(5) sprite.move_right(500) stage.event_key("space", space_bar)
  • Run Code
  • Submit Work
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)