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.

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)