diff --git a/calculator.py b/calculator.py index 24a2fef..77f2434 100644 --- a/calculator.py +++ b/calculator.py @@ -13,4 +13,20 @@ 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) + +def square(x): + return x ** 2 + + +def cube(x): + return x ** 3 + + +def square_n_times(number, n): + total = 0 + current = number + for _ in range(n): + current = square(current) + total += current + return total \ No newline at end of file