python class instance variables and class variables
I’m having a problem understanding how class / instance variables work in Python. I don’t understand why when I try this code the list variable seems to be a class variable
I’m having a problem understanding how class / instance variables work in Python. I don’t understand why when I try this code the list variable seems to be a class variable
“create a default value based on the instance name of the class
without passing in an extra argument.”
Is this a valid python behavior? I would think that the end result should be [0,0,0] and the id() function should return identical values each iteration. How to make it pythonic, and not use enumerate or range(len(bar))?