Skip to content

Test #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Test #32

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 15 additions & 20 deletions calculator.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,47 @@

"""
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.

Note: `*` is the multiplication operator in Python.

Args:
x (int): The first parameter.
y (str): The second parameter.
y (int): The second parameter.

Returns:
int: The sum of `x` and `y`.
"""
return x * y
return x + y

def multiplication(x: int, y: int) -> int:
"""
Multiplies two numbers.

Note: `+` is the addition operator in Python.

Args:
x (int): The first parameter.
y (str): The second parameter.
y (int): The second parameter.

Returns:
int: The multiple of `x` and `y`.
int: The product 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.

Note: `//` is the *integer* division operator in Python.
Divides two numbers.

Args:
x (int): The first parameter.
y (str): The second parameter.
y (int): The second parameter.

Returns:
int: `x` divided by `y`.
float: The result of `x` divided by `y`.

Raises:
ValueError: If `y` is zero.
"""
return x // y
if y == 0:
raise ValueError("Cannot divide by zero")
return x / y # Floating-point division