From aebc88c3751d96681a3819692e4399972306d731 Mon Sep 17 00:00:00 2001 From: joycooperzzz Date: Tue, 7 Feb 2023 21:45:30 -0800 Subject: [PATCH 1/2] BUGFIX: Implement 3-arg subtraction --- src/calc_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calc_test.py b/src/calc_test.py index 2911910..4574744 100644 --- a/src/calc_test.py +++ b/src/calc_test.py @@ -16,7 +16,8 @@ def test_add_zeroes(self): def test_sub_2arg(self): # Make sure 4 - 3 = 1 self.assertEqual(sub(4, 3), 1, 'subtracting three from four') - + def test sub_3arg(self): +     self.assertEqual(sub(4, 3, 1), 0, 'subtracting three and one from four') if __name__ == '__main__': unittest.main() From bec00693ba25775940254b418d6a352d8b018063 Mon Sep 17 00:00:00 2001 From: joycooperzzz Date: Tue, 7 Feb 2023 21:52:38 -0800 Subject: [PATCH 2/2] added new function in calc.py --- src/calc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calc.py b/src/calc.py index 2af3c17..5c8ae15 100644 --- a/src/calc.py +++ b/src/calc.py @@ -18,3 +18,6 @@ def sub(a, b): ``` """ return a - b + +def sub(a, b, c=0): + return a - b - c