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

Function nor_gate

boolean_algebra/nor_gate.py:19–34  ·  view source on GitHub ↗

>>> nor_gate(0, 0) 1 >>> nor_gate(0, 1) 0 >>> nor_gate(1, 0) 0 >>> nor_gate(1, 1) 0 >>> nor_gate(0.0, 0.0) 1 >>> nor_gate(0, -7) 0

(input_1: int, input_2: int)

Source from the content-addressed store, hash-verified

17
18
19def nor_gate(input_1: int, input_2: int) -> int:
20 """
21 >>> nor_gate(0, 0)
22 1
23 >>> nor_gate(0, 1)
24 0
25 >>> nor_gate(1, 0)
26 0
27 >>> nor_gate(1, 1)
28 0
29 >>> nor_gate(0.0, 0.0)
30 1
31 >>> nor_gate(0, -7)
32 0
33 """
34 return int(input_1 == input_2 == 0)
35
36
37def truth_table(func: Callable) -> str:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected