diff --git a/src/main/py/logical_operations.py b/src/main/py/logical_operations.py index 6b3b78a..9edc386 100644 --- a/src/main/py/logical_operations.py +++ b/src/main/py/logical_operations.py @@ -21,3 +21,10 @@ def identity(first_input, operator, second_input): return identity_disconjunctive(first_input, second_input) else: return identity_conjunctive(first_input, second_input) + + +def one_zero(first_input, second_input): + if first_input == 0 and second_input == 0: + return None + else: + return 1 diff --git a/src/test/py/test_logical_operations.py b/src/test/py/test_logical_operations.py index f994cc2..1667909 100644 --- a/src/test/py/test_logical_operations.py +++ b/src/test/py/test_logical_operations.py @@ -33,6 +33,9 @@ class calculationsWithRoots(unittest.TestCase): def test_identity_1_and_1_equals_1(self): self.assertEqual(identity(1, ".", 1), 1) + def test_one_zero_1_or_1_equals_1(self): + self.assertEqual(one_zero(1, 1), 1) + if __name__ == "__main__": unittest.main()