Skip to content

Commit d5ac985

Browse files
authored
Update calculator.py
1 parent 803efd7 commit d5ac985

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

calculator.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +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(
86

97
def addition(x: int, y: int) -> int:
108
"""
@@ -19,7 +17,7 @@ def addition(x: int, y: int) -> int:
1917
Returns:
2018
int: The sum of `x` and `y`.
2119
"""
22-
return x * y
20+
return x + y
2321

2422
def multiplication(x: int, y: int) -> int:
2523
"""
@@ -34,19 +32,19 @@ def multiplication(x: int, y: int) -> int:
3432
Returns:
3533
int: The multiple of `x` and `y`.
3634
"""
37-
return x + y
35+
return x * y
3836

39-
def division(x: int, y: int) -> int:
37+
def division(x: int, y: int) -> float:
4038
"""
41-
Multiplies two numbers.
39+
Divides two numbers.
4240
4341
Note: `//` is the *integer* division operator in Python.
4442
4543
Args:
4644
x (int): The first parameter.
47-
y (str): The second parameter.
45+
y (int): The second parameter.
4846
4947
Returns:
50-
int: `x` divided by `y`.
48+
float: `x` divided by `y`.
5149
"""
52-
return x // y
50+
return x / y

0 commit comments

Comments
 (0)