Challenge 3: Debug the program so that a blue circle appears on the stage if any only if you choose circle.

  • Click Run and type square into the ask bubble to see the error on the stage.
  • Debug the program then click Run and type in circle again to check your work.

Hint: Commands that run as part of an if statement should have a yellow block ···· in front of them to show they are indented 4 spaces.

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

sprite = codesters.Sprite("snowman") sprite.go_to(-140, -125) choice = sprite.ask("Square or circle?") if choice == "square": sprite.say("square!") sprite = codesters.Square(50, 100, 75, "green") if choice == "circle": sprite.say("circle!") sprite = codesters.Circle(50, 0, 100, "blue")
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)