Static Instance Attributes (Python OOP) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Static Instance Attributes (Python OOP)

Hello guys, it's me again 🤣 I want to ask something, in my code below, I have an attribute named "info", and basically what info does is it collects information about hero's objects (Its name and hp) But, when I changed the hero's name, the info attribute didn't change. Even though the hero's name did change. So what happens here? Does string formatting make info attribute to be static? I know we could use getter method instead, but I just wanna know what's happening under the hood. Sorry If my English is pretty lousy, Thank You 🙇 https://code.sololearn.com/cF2Ttl315Baz/?ref=app

28th Jun 2020, 2:38 AM
ArthD
ArthD - avatar
1 Answer
+ 2
~ swim ~ Rithea Sreng Thank you so much guys 🙏🙏, yeah why I don't think that way before 🤣
28th Jun 2020, 3:15 AM
ArthD
ArthD - avatar