Still not sure if I understand, but is it this
class Cycler(object): def __init__(self, data): self.data = data def increase(self, value): self.data += value # create instance of class Cycler cycler = Cycler(2) #access instance property data print(cycler.data) #change instance property data cycler.increase(3) #access instance property data again print(cycler.data)You access members (properties and methods) using
self.
self
being used to reference the instance is just a convention.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs