Calculate IMPLY of the input values >>> imply_gate(0, 0) 1 >>> imply_gate(0, 1) 1 >>> imply_gate(1, 0) 0 >>> imply_gate(1, 1) 1
(input_1: int, input_2: int)
| 18 | |
| 19 | |
| 20 | def imply_gate(input_1: int, input_2: int) -> int: |
| 21 | """ |
| 22 | Calculate IMPLY of the input values |
| 23 | |
| 24 | >>> imply_gate(0, 0) |
| 25 | 1 |
| 26 | >>> imply_gate(0, 1) |
| 27 | 1 |
| 28 | >>> imply_gate(1, 0) |
| 29 | 0 |
| 30 | >>> imply_gate(1, 1) |
| 31 | 1 |
| 32 | """ |
| 33 | return int(input_1 == 0 or input_2 == 1) |
| 34 | |
| 35 | |
| 36 | def recursive_imply_list(input_list: list[int]) -> int: |
no outgoing calls
no test coverage detected