import machine
from machine import Pin
number1 = Pin(4, Pin.IN, Pin.PULL_UP) # A
number2 = Pin(5, Pin.IN, Pin.PULL_UP) # B
led0 = Pin(0, Pin.OUT)
led1 = Pin(1, Pin.OUT)
# suma de dos números de 1 bit
while True:
A = number1.value()
B = number2.value()
AND = A and B
led1.value(AND)
XOR = (not A and B) or (A and not B)
led0.value(XOR)