EDIT2: Thank you all for your help! EDIT: on adding @staticmethod, it works. However I am still wondering why i am getting a type error here.
I have just started OOPS a
class MathsOperations: def __init__ (self, x, y): self.a = x self.b = y def testAddition (self): return (self.a + self.b) def testMultiplication (self): return (self.a * self.b)
then
temp = MathsOperations() print(temp.testAddition())