From c65f708e1dad61f20da44992b4e0591f4c384a47 Mon Sep 17 00:00:00 2001 From: Cobbi <31541737+GeneralCorn@users.noreply.github.com> Date: Fri, 23 Sep 2022 08:25:30 +0800 Subject: [PATCH 1/2] Update calculator.py fix bugs --- calculator.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/calculator.py b/calculator.py index a5c3aed..d064c3a 100644 --- a/calculator.py +++ b/calculator.py @@ -3,9 +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: """ Adds two numbers. @@ -19,7 +16,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,7 +31,7 @@ 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: """ @@ -49,4 +46,4 @@ def division(x: int, y: int) -> int: Returns: int: `x` divided by `y`. """ - return x // y \ No newline at end of file + return x // y From bb480a10cfb3a774b276abebb5778a8a5f39efa7 Mon Sep 17 00:00:00 2001 From: Cobbi <31541737+GeneralCorn@users.noreply.github.com> Date: Fri, 23 Sep 2022 08:28:13 +0800 Subject: [PATCH 2/2] Update calculator.py --- calculator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calculator.py b/calculator.py index d064c3a..5be838c 100644 --- a/calculator.py +++ b/calculator.py @@ -46,4 +46,4 @@ def division(x: int, y: int) -> int: Returns: int: `x` divided by `y`. """ - return x // y + return x / y