diff --git a/__pycache__/calculator.cpython-312.pyc b/__pycache__/calculator.cpython-312.pyc index 09c608d..08d3c5f 100644 Binary files a/__pycache__/calculator.cpython-312.pyc and b/__pycache__/calculator.cpython-312.pyc differ diff --git a/calculator.py b/calculator.py index 24a2fef..05ef9d3 100644 --- a/calculator.py +++ b/calculator.py @@ -10,7 +10,27 @@ def subtract(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) \ No newline at end of file +print(x) + +def square(x): + """Return x squared.""" + return x ** 2 + + +def cube(x): + """Return x cubed.""" + return x ** 3 + +def square_n_times(number, n): + """Square the number n times and return the sum.""" + total = 0 + current = number + + for _ in range(n): + current = current ** 2 + total += current + + return total +