class Calculator:
@staticmethod
def add(n1, n2):
return n1 + n2
@staticmethod
def subtract(n1, n2):
return n1 - n2
@staticmethod
def divide(n1, n2):
if n2 != 0:
return n1 / n2
@staticmethod
def multiply(n1, n2):
return n1 * n2
Еще 3 варианта решения мы закинули на наш сайт: pythonturbo.ru/zadacha…kulyator
#новичок #coбес