Browse Source

Added one_zero functionality and one test for it

remotes/origin/feature/feature-logical-operations
fdai7783 11 months ago
parent
commit
51229aebd7
  1. 7
      src/main/py/logical_operations.py
  2. 3
      src/test/py/test_logical_operations.py

7
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

3
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()
Loading…
Cancel
Save