py4e icon indicating copy to clipboard operation
py4e copied to clipboard

Class and Instance Variables

Open cadenzasong opened this issue 7 years ago • 0 comments

Please correct me if I'm missing something, but I think some code examples in chapter 14 is not accurate.

e.g. in party5.py the "x = 0" and "name = """ is class variables (https://docs.python.org/3.7/tutorial/classes.html#class-and-instance-variables), I think it's clearer to remove them and add self.x = 0 in the constructor.

cadenzasong avatar Jul 03 '18 03:07 cadenzasong