Re: [Tutor] More Doubt with classes
On Tue, 24 Jan 2006, my long-lost cousin Barry wrote: > class Person: ... > def __del__(self): > '''I am dying.''' > print '%s says bye.' % self.name > Person.population -= 1 > > if Person.population == 0: > print 'I am the last one.' > e
[Tutor] More Doubt with classes
Greetings: I took Edgar's script and added some more people. Here is the script as I ran it. class Person: '''Represents a person.''' population = 0 def __init__(self, name): '''Initializes the person's data.''' self.name =