class Person:
def __init__(self, name, age, pay=0, job=None):
self.name = name
self.age = age
self.pay = pay
self.job = job
def lastname(self):
return self.name.split()[-1]
def give(self, passi):
self.pay *= (1.0 + passi)
def __str__(self):
return (' < % s = > % s: % s, % s > ' %
(self.__class__.__name__, self.name, self.job, self.pay))
class Maneger(Person):
def __init__(self, name, age, pay):
Person.__init__(self, name, age, pay, 'mane')
def give(self, passi, bonus = 0.1):
Person.give(self,passi+bonus)
bob = Person('BOB SWICH', 55, 5000, 'DRIV3')
sue = Person('SUE JONES', 88, 9000, 'Energ')
tom = Maneger('TOM TOMSON', 11, 1000)
print(tom.name, tom.age, tom.pay)
for obj in [bob, sue, tom]:
obj.give(1)
print(obj)
print('! '*10)/code>