From 550532b767089b58861b97c3460b86abe6824fdf Mon Sep 17 00:00:00 2001 From: EOBRIEN2502 Date: Mon, 9 Mar 2026 16:27:19 +0000 Subject: [PATCH] Add substract function --- calculator.py | 5 ++++- test_calculator.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/calculator.py b/calculator.py index c57b806..2954216 100644 --- a/calculator.py +++ b/calculator.py @@ -4,4 +4,7 @@ def add(a,b): # Add function def multiply(a,b): - return a * b \ No newline at end of file + return a * b + +def subtract(a,b): + return a + b diff --git a/test_calculator.py b/test_calculator.py index b6219a5..ae115b5 100644 --- a/test_calculator.py +++ b/test_calculator.py @@ -28,4 +28,6 @@ def test_multiply(): # could check squaring - # could check multiplying by 1 \ No newline at end of file + # could check multiplying by 1 +def test_subtract(): + assert subtract(5, 3) == 2