The code we are about to cover is included in the chapter02/button_gpiozero.py file. Please review and run this file. The LED should turn on and off as you press the button. As per the circuit in Figure 2.1, the LED is still connected to GPIO 21, while our button is connected to GPIO 23.
As mentioned previously in the Creating a breadboard circuit section, if your button has four legs (two sets will be electrically joined) and your circuit does not work, try rotating the button in the breadboard 90 degrees.
Let's walk through the significant parts of the code, noting that we are skipping sections of code that we've already covered.