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

RULE: If an event doesn't have any code indented underneath, the program will throw an error.

  • Click Run and read the error message.
  • Debug the program so your micro:bit says something when you press A.

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

stage.set_background("hauntedhouse") microbit = codesters.Microbit() sprite = codesters.Sprite("ghost", 0, -100) sprite.say("Click A to see a message!") def button_a(): microbit.show_string('Boo!') microbit.event_button_a(button_a)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)