from machine import Pin
relay = Pin(15, Pin.OUT)
push_button = Pin(13, Pin.IN)
while True: #infinite loop
logic_state=push_button.value() #storing the value of the push button state in the variable logic_state
if logic_state==True: #if state of button is logic 1
relay.value(1) #LED is ON
print("relay on")
else:
relay.value(0) #LED is OFF
print("relay off")