From 84ffe011d261dbfffd984e5fdcda7d7cf45ab87d Mon Sep 17 00:00:00 2001 From: hshimizu01 Date: Tue, 13 Jan 2026 22:22:32 -0500 Subject: [PATCH 1/5] add functions to calculator --- calculator.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 calculator.py diff --git a/calculator.py b/calculator.py new file mode 100644 index 0000000..b4eedf6 --- /dev/null +++ b/calculator.py @@ -0,0 +1,11 @@ +def add(a, b): + return a + b + +def subtract(a, b): + return a - b + +def multiply(a, b): + return a * b + +def divide(a, b): + return a / b From bba7875dd7e354d66a9e5d446dca943e8924ef67 Mon Sep 17 00:00:00 2001 From: hshimizu01 Date: Tue, 13 Jan 2026 22:24:39 -0500 Subject: [PATCH 2/5] I printed the answer of 30 divided by 6 --- calculator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/calculator.py b/calculator.py index b4eedf6..b91d577 100644 --- a/calculator.py +++ b/calculator.py @@ -9,3 +9,7 @@ def multiply(a, b): def divide(a, b): return a / b + +print("I'm going use the calculator functions to divide 30 by 6") +x = divide(30,6) +print(x) From 76f46ccafe6d308abae54e674474088410df77ca Mon Sep 17 00:00:00 2001 From: hshimizu01 Date: Tue, 13 Jan 2026 22:33:03 -0500 Subject: [PATCH 3/5] defined add, subtract, divide, multiply functions and printed division of 30 / 6 --- calculator.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/calculator.py b/calculator.py index 1389a9f..b91d577 100644 --- a/calculator.py +++ b/calculator.py @@ -13,19 +13,3 @@ def divide(a, b): print("I'm going use the calculator functions to divide 30 by 6") x = divide(30,6) print(x) -def multiply(a,b): - return a * b - -def add(a,b): - return a+b - -def subtract(a,b): - return a-b - -def divide(a,b): - return a/b - - -print("I'm going use the calculator functions to multiply 5 and 6") -x = multiply(5,6) -print(x) From de69341ee17b018da2901445227351f5944b0894 Mon Sep 17 00:00:00 2001 From: hshimizu01 Date: Sun, 18 Jan 2026 09:25:42 -0500 Subject: [PATCH 4/5] slightly altered print line to pick up where i left off with hw --- calculator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calculator.py b/calculator.py index b91d577..547bda2 100644 --- a/calculator.py +++ b/calculator.py @@ -12,4 +12,4 @@ def divide(a, b): print("I'm going use the calculator functions to divide 30 by 6") x = divide(30,6) -print(x) +print(x) From 14f491fa39cad45865e60b8cc976d0491094b0c6 Mon Sep 17 00:00:00 2001 From: hshimizu01 Date: Sun, 18 Jan 2026 09:42:35 -0500 Subject: [PATCH 5/5] added square and cube finallyy --- calculator.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/calculator.py b/calculator.py index 547bda2..6681b42 100644 --- a/calculator.py +++ b/calculator.py @@ -10,6 +10,32 @@ def multiply(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): + updated_number = 0 + changed_number = number + for times in range(n): + changed_number = changed_number * changed_number + updated_number = updated_number + changed_number + return updated_number + print("I'm going use the calculator functions to divide 30 by 6") x = divide(30,6) print(x) + +# print("I'm going use the calculator functions to raise 30 by the power of 2") +# x = square(30) +# print(x) + +# print("I'm going use the calculator functions to determine 30 cubed") +# x = cube(30) +# print(x) + +# print("I'm going use the calculator functions to determine 3 cubed") +# x = square_n_times(3, 3) +# print(x) \ No newline at end of file