From 4201d95d18bd7dc8d1fff001868112d2f2ee681a Mon Sep 17 00:00:00 2001 From: Richard Nesta Date: Thu, 4 May 2023 14:35:01 -0500 Subject: [PATCH 1/2] BUGFIX: Implement 3-arg subtraction --- src/calc_test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calc_test.py b/src/calc_test.py index 2911910..088048f 100644 --- a/src/calc_test.py +++ b/src/calc_test.py @@ -17,6 +17,10 @@ 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 b7cfcca58c5a3d3cac28879973ae58f1525ab879 Mon Sep 17 00:00:00 2001 From: Richard Akindele <57931156+Nesta3313@users.noreply.github.com> Date: Thu, 4 May 2023 14:43:18 -0500 Subject: [PATCH 2/2] Updated calc.py added 3-arg sub function --- src/calc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calc.py b/src/calc.py index 2af3c17..563720f 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