class Calculator(object): def add(self, x, y): return x + y def subtract(self, x, y): return x - y
Time is over! You can keep submitting you assignments, but they won't compute for the score of this quiz.
Create a class
Calculator that has two methods
subtract which receive two numbers and perform the intended operations (returning the value). Example:
c = Calculator() c.add(2, 5) # 7 c.subtract(9, 6) # 3