Our first gate is the NAND gate. This gate receives two inputs and returns current as long as at least one of the inputs is off.

Here’s the truth table:

a b output
0 0 1
0 1 1
1 0 1
1 1 0



We’ve written most of a NAND gate in the script.py file. Finish the remaining case so all our test cases pass!

Run the file to run the test cases!

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?