+ 1
[solved] Why the value of class member is not changing ❓
2 Respuestas
+ 1
Changing the value of class variable using an object does not affect it, but creating a new variable that shadows the class variable for the particular object. You need to use the class name to change the class variable.
Related post:
https://www.geeksforgeeks.org/g-fact-42-changing-class-members-JUMP_LINK__&&__python__&&__JUMP_LINK/
0
to change the value of the class member, use A.x = value. if you use an object to change the member, you will just... change the object member value not the class member!