Post

@PythonPr Answer:C). 30
Why!?
The code first creates an instance of the Rectangle class named rect with a width of 5 and a height of 3. Due to Python's name mangling for attributes starting with __, the __height attribute is stored internally as _Rectangle__height.
English


@PythonPr width = 10
height = rect._Rectangle__height = 3
area = 10 × 3 = 30
English

@PythonPr Answer: 15
Because __height is name-mangled, updating rect.__height doesn’t change the original private variable.
English

@PythonPr 30
Name mangling of __height attribute returns 10*3
English














