I have created a Python class:
class calculator:
def addition(self,x,y):
added = x + y
print(added)
def subtraction(self,x,y):
sub = x - y
print(sub)
def multiplication(self,x,y):
mult = x * y
print(mult)
def division(self,x,y):
div = x / y
print(div)
Now when I am calling the function like this:
calculator.addition(2,3)
I am getting an error:
addition() missing 1 required positional argument: 'y'
What is the problem? What could be the solution so that I can call it like addition(2,3)
?