MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / not_gate

Function not_gate

boolean_algebra/not_gate.py:15–24  ·  view source on GitHub ↗

Calculate NOT of the input values >>> not_gate(0) 1 >>> not_gate(1) 0

(input_1: int)

Source from the content-addressed store, hash-verified

13
14
15def not_gate(input_1: int) -> int:
16 """
17 Calculate NOT of the input values
18 >>> not_gate(0)
19 1
20 >>> not_gate(1)
21 0
22 """
23
24 return 1 if input_1 == 0 else 0
25
26
27if __name__ == "__main__":

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected