class class1(): def setdata(self,value1, value2): self.data = value1+value2 def display(self): print(self.data)
For the above code, when I
class class1: def setdata(self,value1, value2=456): self.data = value1+value2 def display(self): print(self.data)
may be this solves your problem