diff --git a/__pycache__/calculator.cpython-314.pyc b/__pycache__/calculator.cpython-314.pyc new file mode 100644 index 0000000..faa757c Binary files /dev/null and b/__pycache__/calculator.cpython-314.pyc differ diff --git a/__pycache__/test_calculator.cpython-314-pytest-9.0.2.pyc b/__pycache__/test_calculator.cpython-314-pytest-9.0.2.pyc new file mode 100644 index 0000000..29c638c Binary files /dev/null and b/__pycache__/test_calculator.cpython-314-pytest-9.0.2.pyc differ diff --git a/calculator.py b/calculator.py index 24a2fef..1d3a8be 100644 --- a/calculator.py +++ b/calculator.py @@ -1,15 +1,30 @@ -def multiply(a,b): - return a * b - 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 +def square(a): + return a*a + +def cube(a): + return a*a*a + +def square_n_times(number, n): + if n < 0: + raise ValueError("n must be non-negative number") + total = 0 + value = number + for _ in range(n): + value = value * value + total += value + return total print("I'm going use the calculator functions to multiply 5 and 6") x = multiply(5,6)