diff --git a/__pycache__/calculator.cpython-313-pytest-9.0.2.pyc b/__pycache__/calculator.cpython-313-pytest-9.0.2.pyc new file mode 100644 index 0000000..8354e54 Binary files /dev/null and b/__pycache__/calculator.cpython-313-pytest-9.0.2.pyc differ diff --git a/__pycache__/calculator.cpython-313.pyc b/__pycache__/calculator.cpython-313.pyc new file mode 100644 index 0000000..861a25f Binary files /dev/null and b/__pycache__/calculator.cpython-313.pyc differ diff --git a/__pycache__/test_calculator.cpython-313-pytest-9.0.2.pyc b/__pycache__/test_calculator.cpython-313-pytest-9.0.2.pyc new file mode 100644 index 0000000..83bd533 Binary files /dev/null and b/__pycache__/test_calculator.cpython-313-pytest-9.0.2.pyc differ diff --git a/calculator.py b/calculator.py index 24a2fef..d78a6bf 100644 --- a/calculator.py +++ b/calculator.py @@ -1,16 +1,38 @@ -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) \ No newline at end of file + +def multiply(a, b): + """Multiply two numbers.""" + return a * b + +def add(a, b): + """Add two numbers.""" + return a + b + +def subtract(a, b): + """Subtract b from a.""" + return a - b + +def divide(a, b): + """Divide a by b.""" + return a / b + +def square(a): + """Square a number.""" + return a ** 2 + +def cube(a): + """Cube a number.""" + return a ** 3 + +def square_n_times(number, n): + """Square the number n times and return the sum of all intermediate values.""" + result = number + total = number + for i in range(n): + result = result ** 2 + total += result + return total + +print("I'm going use the calculator functions to multiply 5 and 6") +x = multiply(5,6) +print(x) +