from machine import Pin
import time
button = Pin(2, Pin.IN, Pin.PULL_UP)
led1 = Pin(18, Pin.OUT)
led2 = Pin(19, Pin.OUT)
while True:
if button.value():
led1.value(1)
print('lampu menyala')
else:
led1.value(0)
print('lampu mati')
if button.value():
led2.value(0)
print('lampu mati')
else:
led2.value(1)
print('lampu menyala')
time.sleep_ms(200)