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

If an event function 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 outputs the amount of light it senses every four seconds.

Hint: We need to indent two lines of code to make this program run correctly.

stage.set_background("city") microbit = codesters.Microbit() def interval(): light = microbit.get_light() microbit.show_number(light) stage.event_interval(interval, 4)