1
0
forked from tdwojak/Python2017
Python2017/labs04/task02.py

34 lines
653 B
Python
Raw Normal View History

2017-12-03 13:05:05 +01:00
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
2018-01-19 22:11:27 +01:00
import time
2017-12-03 13:05:05 +01:00
2018-01-19 22:11:27 +01:00
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()