from machine import Pin
import time
switch_pin = Pin(0, Pin.IN)
Led_pin=Pin(2,Pin.OUT)
while True:
switch_state = switch_pin.value()
if switch_state == 0:
Led_pin.value(1)
else:
Led_pin.value(0)
#time.sleep(1)