class Calculator:
def add(self,a,b):
if a>99 or a<-99 or b>99 or b<-99:
print(“请输入【-99,99】的数”)
return “参数不合法”
return a+b
def reduce(self,a,b):
if a>99 or a<-99 or b>99 or b<-99:
print(“请输入【-99,99】的数”)
return “参数不合法”
return a-b
def multiple(self,a,b):
if a>99 or a<-99 or b>99 or b<-99:
print("请输入【-99,99】的数")
return "参数不合法"
return a*b
def div(self,a,b):
if a>99 or a<-99 or b>99 or b<-99:
print("请输入【-99,99】的数")
return "参数不合法"
return a/b