From: Python-list <python-list-bounces+jcasale=activenetwerx....@python.org> on behalf of Irv Kalb <i...@furrypants.com> Sent: Monday, April 16, 2018 10:03 AM To: python-list@python.org Subject: Instance variables question > class PartyAnimal(): > x = 0 > > def party(self): > self.x = self.x + 1 > print('So far', self.x)
Your not accessing the class variable here, self.x != PartyAnimal.x. -- https://mail.python.org/mailman/listinfo/python-list