File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change 1-
21"""
32An extremely buggy Python math library . . .
43"""
54
6- # Should this function even be here?
7-
85def addition (x : int , y : int ) -> int :
96 """
107 Adds two numbers.
118
12- Note: `+` is the addition operator in Python.
13-
149 Args:
1510 x (int): The first parameter.
1611 y (int): The second parameter.
@@ -24,30 +19,29 @@ def multiplication(x: int, y: int) -> int:
2419 """
2520 Multiplies two numbers.
2621
27- Note: `*` is the multiplication operator in Python.
28-
2922 Args:
3023 x (int): The first parameter.
3124 y (int): The second parameter.
3225
3326 Returns:
34- int: The multiple of `x` and `y`.
27+ int: The product of `x` and `y`.
3528 """
3629 return x * y
3730
3831def division (x : int , y : int ) -> int :
3932 """
40- Multiplies two numbers.
41-
42- Note: `//` is the *integer* division operator in Python.
33+ Divides two numbers using integer division.
4334
4435 Args:
4536 x (int): The first parameter.
4637 y (int): The second parameter.
4738
4839 Returns:
49- int: `x` divided by `y`.
40+ int: `x` divided by `y` (integer division).
41+
42+ Raises:
43+ ValueError: If `y` is zero.
5044 """
5145 if y == 0 :
52- raise ValueError ("You can not divide by 0"
46+ raise ValueError ("Cannot divide by zero" )
5347 return x // y
You can’t perform that action at this time.
0 commit comments