Skip to content

Commit bb1a2c5

Browse files
Update calculator.py
1 parent 803efd7 commit bb1a2c5

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

calculator.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
An extremely buggy Python math library . . .
44
"""
55

6-
# Should this function even be here?
7-
def poorly_implemented_function_with_no_close_parenthesis(
8-
96
def addition(x: int, y: int) -> int:
107
"""
118
Adds two numbers.
@@ -19,7 +16,7 @@ def addition(x: int, y: int) -> int:
1916
Returns:
2017
int: The sum of `x` and `y`.
2118
"""
22-
return x * y
19+
return x + y
2320

2421
def multiplication(x: int, y: int) -> int:
2522
"""
@@ -34,11 +31,11 @@ def multiplication(x: int, y: int) -> int:
3431
Returns:
3532
int: The multiple of `x` and `y`.
3633
"""
37-
return x + y
34+
return x * y
3835

3936
def division(x: int, y: int) -> int:
4037
"""
41-
Multiplies two numbers.
38+
Divide two numbers.
4239
4340
Note: `//` is the *integer* division operator in Python.
4441
@@ -49,4 +46,4 @@ def division(x: int, y: int) -> int:
4946
Returns:
5047
int: `x` divided by `y`.
5148
"""
52-
return x // y
49+
return x / y

0 commit comments

Comments
 (0)