From 40821483af880b0a9a59c4500d5cf03523d1e1f6 Mon Sep 17 00:00:00 2001 From: Matthew Baird Date: Wed, 4 Jan 2023 11:51:47 -0500 Subject: [PATCH] BUGFIX: 3-arg subtraction was not implemented. The following change allows use of sub like .. Now added! This is a bug, not an enhacenement. --- src/calc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calc.py b/src/calc.py index 2af3c17..bcc717a 100644 --- a/src/calc.py +++ b/src/calc.py @@ -9,7 +9,7 @@ def add(a, b, third_operand = 0): """ return a + b + third_operand -def sub(a, b): +def sub(a, b, c=0): """ Subtract some numbers @@ -17,4 +17,4 @@ def sub(a, b): sub(8, 3) # 5 ``` """ - return a - b + return a - b - c