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

Function nimply_gate

boolean_algebra/nimply_gate.py:20–33  ·  view source on GitHub ↗

Calculate NIMPLY of the input values >>> nimply_gate(0, 0) 0 >>> nimply_gate(0, 1) 0 >>> nimply_gate(1, 0) 1 >>> nimply_gate(1, 1) 0

(input_1: int, input_2: int)

Source from the content-addressed store, hash-verified

18
19
20def nimply_gate(input_1: int, input_2: int) -> int:
21 """
22 Calculate NIMPLY of the input values
23
24 >>> nimply_gate(0, 0)
25 0
26 >>> nimply_gate(0, 1)
27 0
28 >>> nimply_gate(1, 0)
29 1
30 >>> nimply_gate(1, 1)
31 0
32 """
33 return int(input_1 == 1 and input_2 == 0)
34
35
36if __name__ == "__main__":

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected