Oct-15-2017, 12:54 AM
Your last line should be
c.add(d)
. You want to call it from the instance, so the instance parameter (self) is automatically filled. Also note that the print in the add method should be print(self.a)
, since a is an attribute of the instance. Finally, what I was talking about with the a parameter to __init__ was more like this:def __init__(self, a = None): if a is None: a = [] self.a = a print(a)
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures