From d5ac9854be2a117289d40596f4195390443eb966 Mon Sep 17 00:00:00 2001 From: Quinten Schafer <129530873+seventhriver@users.noreply.github.com> Date: Thu, 6 Feb 2025 18:27:21 -0600 Subject: [PATCH] Update calculator.py --- calculator.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/calculator.py b/calculator.py index a5c3aed..38b5082 100644 --- a/calculator.py +++ b/calculator.py @@ -3,8 +3,6 @@ An extremely buggy Python math library . . . """ -# Should this function even be here? -def poorly_implemented_function_with_no_close_parenthesis( def addition(x: int, y: int) -> int: """ @@ -19,7 +17,7 @@ def addition(x: int, y: int) -> int: Returns: int: The sum of `x` and `y`. """ - return x * y + return x + y def multiplication(x: int, y: int) -> int: """ @@ -34,19 +32,19 @@ def multiplication(x: int, y: int) -> int: Returns: int: The multiple of `x` and `y`. """ - return x + y + return x * y -def division(x: int, y: int) -> int: +def division(x: int, y: int) -> float: """ - Multiplies two numbers. + Divides two numbers. Note: `//` is the *integer* division operator in Python. Args: x (int): The first parameter. - y (str): The second parameter. + y (int): The second parameter. Returns: - int: `x` divided by `y`. + float: `x` divided by `y`. """ - return x // y \ No newline at end of file + return x / y