Post

@PythonPr obj is an instance of the Square class. obj.side is assigned a value of 8. When the function is called, 8 is squared in the return statement. The print statement gives us both the value of obj.side and the value of the return - so, 8 64
English

@PythonPr 8, 64 ? Why object is a squared class & object.side is assigned as 8, we’ll get 64 as soon as function being called. Finally, give us the value
English

@PythonPr >>> class Rectangle:
... def getArea(self):
... return self.long*self.short
...
>>> obj.long=8
>>> obj.short=4
>>> print(obj.long,obj.short,obj.getAreaRectangle())
8 4 32
English







