diff --git a/src/main/py/logical_operations.py b/src/main/py/logical_operations.py index 3b0ac5a..7248048 100644 --- a/src/main/py/logical_operations.py +++ b/src/main/py/logical_operations.py @@ -7,8 +7,10 @@ def identity_disconjunctive(first_input, operator, second_input): return 1 -def identity_conjunctive(variable, operator, zero): - if zero == 1 and operator == ".": - return variable - else: +def identity_conjunctive(first_input, operator, second_input): + if first_input == 1 and second_input == 1: + return 1 + elif first_input == 0 and second_input == 0: return None + else: + return 0 diff --git a/src/test/py/test_logical_operations.py b/src/test/py/test_logical_operations.py index 4099b13..a8c0994 100644 --- a/src/test/py/test_logical_operations.py +++ b/src/test/py/test_logical_operations.py @@ -25,7 +25,7 @@ class calculationsWithRoots(unittest.TestCase): self.assertEqual(identity_conjunctive(0, ".", 0), None) def test_conjunctive_identity_1_and_0_equals_None(self): - self.assertEqual(identity_conjunctive(1, ".", 0), None) + self.assertEqual(identity_conjunctive(1, ".", 0), 0) def test_conjunctive_identity_0_and_1_equals_0(self): self.assertEqual(identity_conjunctive(0, ".", 1), 0)