forked from tdwojak/Python2017
34 lines
653 B
Python
34 lines
653 B
Python
#!/usr/bin/env python2
|
|
# -*- coding: utf-8 -*-
|
|
import time
|
|
|
|
class Employee:
|
|
id = int(time.time())
|
|
|
|
def __init__(self, name, surname):
|
|
self.name = name
|
|
self.surname = surname
|
|
|
|
def get_id(self):
|
|
return self.id
|
|
|
|
# Check the first class
|
|
x = Employee('Mateusz', 'Kowalski')
|
|
print x.get_id()
|
|
|
|
# Second class
|
|
class Recruiter(Employee):
|
|
recruited = []
|
|
def recruit(self):
|
|
self.recruited.append(self.get_id())
|
|
|
|
# Check the second class
|
|
y = Recruiter('Mateusz', 'Kowalski')
|
|
y.recruit()
|
|
print y.recruited
|
|
|
|
# Third class
|
|
class Programmer(Recruiter):
|
|
def recruiter(self):
|
|
self.recruiter = self.get_id()
|