from machine import Pin
from utime import sleep

led=Pin(1,Pin.OUT)
buzzer=Pin(0,Pin.OUT)
button=Pin(2,Pin.IN,Pin.PULL_DOWN)

while True:
    if button.value():
        led.value(1)
        buzzer.value(1)
        sleep(0.5)
    else:
        led.value(0)
        buzzer.value(0)
        sleep(0.5)
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT