class Fn1: # 员工
def __init__(self, name, emp_no, salary):
self.name = name
self.emp_no = emp_no
self.salary = salary
class Fn2(Fn1): # 柜员
def work(self, name, emp_no, salary):
super().__init__(name, emp_no, salary)
print(f'{self.name}推销商品')
class Fn3(Fn1): # 经理
def car(self, name, emp_no, salary):
super().__init__(name, emp_no, salary)
print(f'{self.name}开公务车')
class Fn4(Fn1): # 董事
def work(self, name, emp_no, salary):
super().__init__(name, emp_no, salary)
print(f'{self.name}投票决定公司发展')
class Fn5(Fn3, Fn4):
def work(self, name, emp_no, salary):
super().__init__(name, emp_no, salary)
super().work(name, emp_no, salary)
print(f'{self.name}是总经理')
p1 = Fn1('张三', 1213, 3000)
p2 = Fn2('王五', 4534, 4000)
p2.work('王五', 4534, 4000)
p3 = Fn3('二麻子', 7869, 5000)
p3.car('二麻子', 7869, 5000)
p4 = Fn4('WBD', 4325, 30000)
p4.work('WBD', 4325, 30000)
p5 = Fn5('ASDD', 0000, 12300000)
p5.work('ASDD', 0000, 12300000)
p5.car('ASDD', 0000, 12300000)