Image

Imageklinky wrote in Imagepython_dev

Objects held in lists...

Code:
class Taco:
    class Skills:
        agility = 1
        speed = 1
y=[]
y.append(Taco)
y.append(Taco)
y.append(Taco)

y[0].Skills.agility=4
print y[0].Skills.agility
print y[2].Skills.agility


ouput:

4
4


Why when I change the value of the object @ index 0 does it affect the object @ index 2? Maybe I am missing something here. I am a Python noob, if that's an excuse...