Python2017/labs04/task02.py

28 lines
581 B
Python
Raw Normal View History

2017-12-03 13:05:05 +01:00
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
2017-12-03 15:40:52 +01:00
class Employee:
2017-12-16 00:19:41 +01:00
_id = 0
def __init__(self, name, surname):
Employee._id += 1
self.id = Employee._id
self.name = name
self.surname = surname
def get_id(self):
return self.id
class Recruiter(Employee):
recruited = []
def recruit(self, Employee):
emp_id = Employee.id
self.recruited.append(emp_id)
class Programmer(Employee):
def __init__(self, name, surname, Recruiter):
super().__init__(name, surname)
self.recruiter = Recruiter.id