From e3d14fd93d09509b133c4413de97a0e06ec8b50d Mon Sep 17 00:00:00 2001 From: cvanderwood Date: Mon, 19 Jan 2026 15:45:07 -0500 Subject: [PATCH 1/4] add functions to calculator --- calculator.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/calculator.py b/calculator.py index 24a2fef..a87a280 100644 --- a/calculator.py +++ b/calculator.py @@ -13,4 +13,16 @@ def divide(a,b): print("I'm going use the calculator functions to multiply 5 and 6") x = multiply(5,6) -print(x) \ No newline at end of file +print(x) + +print("I'm going use the calculator functions to add 5 and 6") +y = add(5,6) +print(y) + +print("I'm going use the calculator functions to subtract 5 and 6") +a = subtract(5,6) +print(a) + +print("I'm going use the calculator functions to divide 5 and 6") +b = divide(5,6) +print(b) \ No newline at end of file From 00d09a48863ab7d7a05372512e2092c9d0b8271d Mon Sep 17 00:00:00 2001 From: cvanderwood Date: Mon, 19 Jan 2026 15:50:42 -0500 Subject: [PATCH 2/4] print result of functions --- calculator.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/calculator.py b/calculator.py index a87a280..d6423cf 100644 --- a/calculator.py +++ b/calculator.py @@ -10,6 +10,21 @@ def subtract(a,b): def divide(a,b): return a/b +print("I'm going use the calculator functions to multiply 10 and 2") +c=multiply(10,2) +print(c) + +print("I'm going use the calculator functions to add 10 and 2") +d = add(10,2) +print(d) + +print("I'm going use the calculator functions to subtract 10 and 2") +e = subtract(10,2) +print(e) + +print("I'm going use the calculator functions to divide 10 and 2") +f = divide(10,2) +print(f) print("I'm going use the calculator functions to multiply 5 and 6") x = multiply(5,6) From 7fc3f6834aee4d7bcfc0fab9e4d4b017b6cd5a07 Mon Sep 17 00:00:00 2001 From: cvanderwood Date: Mon, 19 Jan 2026 16:01:20 -0500 Subject: [PATCH 3/4] add square and cube --- calculator.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/calculator.py b/calculator.py index d6423cf..6800da2 100644 --- a/calculator.py +++ b/calculator.py @@ -10,6 +10,19 @@ def subtract(a,b): def divide(a,b): return a/b +def square(a) + return a*a + +def cube(a): + return a*a*a + +def square_n_times(number, n): + total = 0 + for _ in range(n): + number = square(number) + total += number + return total + print("I'm going use the calculator functions to multiply 10 and 2") c=multiply(10,2) print(c) From 2cf3e236865f5006e46b8a29a1cbe00bae053601 Mon Sep 17 00:00:00 2001 From: cvanderwood Date: Mon, 19 Jan 2026 16:04:45 -0500 Subject: [PATCH 4/4] add colon --- calculator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calculator.py b/calculator.py index 6800da2..8dea3b2 100644 --- a/calculator.py +++ b/calculator.py @@ -10,7 +10,7 @@ def subtract(a,b): def divide(a,b): return a/b -def square(a) +def square(a): return a*a def cube(a):