14 lines
300 B
Python
14 lines
300 B
Python
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 |