You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
class BaseCalculator:
|
|
@staticmethod
|
|
def add(a, b):
|
|
return a + b
|
|
|
|
@staticmethod
|
|
def subtract(a, b):
|
|
return a - b
|
|
|
|
@staticmethod
|
|
def multiply(a, b):
|
|
return a * b
|
|
|
|
@staticmethod
|
|
def divide(a, b):
|
|
if b == 0:
|
|
raise ZeroDivisionError("除数不能为0")
|
|
return a / b |