Files
AI_biancheng/calculator.py

14 lines
300 B
Python
Raw Normal View History

2026-04-02 21:03:03 +08:00
class Calculator:
def add(self, a, b):
return a + b
def subtract(self, a, b):
return a - b
def multiply(self, a, b):
return a * b
def divide(self, a, b):
if b == 0:
raise ValueError("Division by zero is not allowed")
return a / b