The lamp is OFF. It stays dark!

Gate by gate
- NOT B → NOT ON = OFF
- A AND NOT B → ON AND OFF = OFF
- C AND D → OFF AND OFF = OFF
- (A AND NOT B) AND (C AND D) → OFF AND OFF = OFF
The same circuit in Python
Python has the same three gates built in: and, or and not. ON is True and OFF is False.
A = True
B = True
C = False
D = False
lamp = (A and not B) and (C and D)
print("Is the lamp on?", lamp)
When you run it, it prints:
Is the lamp on? False
Try it: change one of the switches from True to False (or the other way round) and run the code again. Can you find a switch that changes the lamp?