#Led control using switch(with internal resistor pullup & pulldown)
from machine import Pin
import time
led=Pin(5,Pin.OUT)
key1=Pin(14,Pin.IN,Pin.PULL_DOWN)
key2=Pin(4,Pin.IN,Pin.PULL_UP)
while True:
if key1.value() == 1 or key2.value() == 0:
led.on()
else:
led.off()