swaroop = Person('Swaroop')
swaroop.sayHi()
swaroop.howMany()
kalam = Person('Abdul Kalam')
kalam.sayHi()
kalam.howMany()
swaroop.sayHi()
swaroop.howMany()
#
MY OUTPUT
(Initializing Swaroop)
Hi, my name is Swaroop.
I am the only person here.
(Initializing Abdul K
Edgar Antonio Rodríguez Velazco wrote:
> Hi everybody,
> I've been reading the chapter of classes of Byte of Python by Swaroop.
> There's an example with classes (11.4) that is below:
The example is depending on Person.__del__() being called on swaroop and
kalam when the intepreter exits. The Py
Hi everybody,
I've been reading the chapter of classes of Byte of Python by Swaroop. There's an example with classes (11.4) that is below:
#
class Person:'''Represents a person.'''population = 0
def __init__(self, name):'''Initializes the person's data.