object = Object() objects.append(object)
This works just fine until I want to create a second object. Take this for example:
for i in range(0,3): object = Object() objects.append(object)
It seems to me that the objects would just be overwriting each other and only the last one would remain. As it is I can't dynamically create new objects. I'm sure this is just me missing some important detail about lists. Can someone tell me how this is done?
Edit: It just occurred to me that I could do it like this once:
for i in range(0,3): i = Object() objects.append(i)
...I think. Python for loops still confuse me. But either way I could only run that loop once and have it work correctly. It seems like I'm still in the same boat.
This post has been edited by Ntwiles: 10 January 2011 - 04:58 PM