Skip to content
Closed
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
21 changes: 21 additions & 0 deletions simple_calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

def add(a, b):

Check failure on line 2 in simple_calculator.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (ANN001)

simple_calculator.py:2:12: ANN001 Missing type annotation for function argument `b`

Check failure on line 2 in simple_calculator.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (ANN001)

simple_calculator.py:2:9: ANN001 Missing type annotation for function argument `a`

Check failure on line 2 in simple_calculator.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (ANN201)

simple_calculator.py:2:5: ANN201 Missing return type annotation for public function `add` help: Add return type annotation
return a + b

def subtract(a, b):

Check failure on line 5 in simple_calculator.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (ANN001)

simple_calculator.py:5:17: ANN001 Missing type annotation for function argument `b`

Check failure on line 5 in simple_calculator.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (ANN001)

simple_calculator.py:5:14: ANN001 Missing type annotation for function argument `a`

Check failure on line 5 in simple_calculator.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (ANN201)

simple_calculator.py:5:5: ANN201 Missing return type annotation for public function `subtract` help: Add return type annotation
return a - b

def multiply(a, b):

Check failure on line 8 in simple_calculator.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (ANN001)

simple_calculator.py:8:17: ANN001 Missing type annotation for function argument `b`

Check failure on line 8 in simple_calculator.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (ANN001)

simple_calculator.py:8:14: ANN001 Missing type annotation for function argument `a`

Check failure on line 8 in simple_calculator.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (ANN201)

simple_calculator.py:8:5: ANN201 Missing return type annotation for public function `multiply` help: Add return type annotation
return a * b

def divide(a, b):

Check failure on line 11 in simple_calculator.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (ANN201)

simple_calculator.py:11:5: ANN201 Missing return type annotation for public function `divide` help: Add return type annotation
if b == 0:
return "Cannot divide by zero"
return a / b


if __name__ == "__main__":
print("Addition:", add(10, 5))
print("Subtraction:", subtract(10, 5))
print("Multiplication:", multiply(10, 5))
print("Division:", divide(10, 5))
Loading