Post

Python Developer
Python Developer@Python_Dv·
Comment below the output! 😃👇
Python Developer tweet media
English
12
3
88
6.2K
Kamal Gurjar
Kamal Gurjar@KamalGurjar8·
@Python_Dv Answer: A) 101 Explanation: __id is name-mangled by Python to _Test__id because it starts with double underscores. Inside __init__, self.__id = 101 sets that mangled attribute. The constructor argument 102 is ignored, so printing test.__id resolves to 101.
English
0
0
5
286
sina sasani
sina sasani@Sinacayenne1994·
@Python_Dv D. Error Because the Test class can’t access to __id and if we want to access to the value it must be print(test._Test__id)
English
0
0
1
153
Paylaş