Remember the while True block from before? We will use an alternative looping block in this project. From the Basics category, get the Loop block. The only difference between these two is that:
- the while True block will repeat forever until we interrupt it with Ctrl+C. Breaking out of the loop and ending the code. However, if we interrupt the code while it’s playing a note on the buzzer, then the buzzer will keep on playing that note forever!
- the Loop block can be ended by holding the LP button on the Little Python Brain. By ending the loop this way, this makes sure that it ends the code when it’s not playing a note!