class sum:
def fx(self, op, a, b, c, d):
if(op == 1):
self.output = self.addition(a, b, c, d)
else:
self.output = self.subtraction(a, b, c, d)
def addition(self, a, b, c, d):
return a+b+c+d
def subtraction(self, a, b, c, d):
return a-b-c-d
x = sum.fx(1, 1, 2, 3, 4)
The above code gives an error
x = sum.fx(1, 1, 2, 3, 4) TypeError: sum.fx() missing 1 required positional argument: 'd'
I am clearly entering the value parameter 'd' but it says that i am not. It should give an output "10"