Post

Python Programming
Python Programming@PythonPr·
Python Question / Quiz; What is the output of the following Python code, and why? Comment your answers below!
Python Programming tweet media
English
21
20
163
12K
Earnest Codes
Earnest Codes@Earnesto037·
@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
1
0
12
555
France
France@LashaPython·
@PythonPr @coding_z/video/7543956907510336790?is_from_webapp=1&sender_device=pc" target="_blank" rel="nofollow noopener">tiktok.com/@coding_z/vide…
QME
10
0
8
103
Kamal Gurjar
Kamal Gurjar@KamalGurjar8·
@PythonPr Answer: 15 Because __height is name-mangled, updating rect.__height doesn’t change the original private variable.
English
0
0
0
385
Paylaş