From 30f63c56dcca3aa8638ea587052a334fb6f9b62e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20G=C3=B6r?= Date: Sat, 1 Jul 2023 17:53:43 +0300 Subject: [PATCH] company second example --- python-temel/company.2.py | 41 ++++++++++++++++++++++++++++++++++++++ python-temel/company.2.py~ | 10 ++++++++++ 2 files changed, 51 insertions(+) create mode 100644 python-temel/company.2.py create mode 100644 python-temel/company.2.py~ diff --git a/python-temel/company.2.py b/python-temel/company.2.py new file mode 100644 index 0000000..1980abd --- /dev/null +++ b/python-temel/company.2.py @@ -0,0 +1,41 @@ +class Employee: + def __init__(self, name, address): + self.name = name + self.address = address + + def disp(self): + print('Adı Soyadı: {}'.format(self.name)) + print('Adres: {}'.format(self.address)) + +class Worker(Employee): + def __init__(self, name, address, shift): + super(Worker, self).__init__(name, address) # Employee.__init_(self, name, address) + self.shift = shift + + def disp(self): + super(Worker, self).disp() # Employee,disp(self) + print('Vardiya: {}'.format(self.shift)) + +class Manager(Employee): + def __init__(self, name, address, department): + super(Manager, self).__init__(name, address) # Employee.__init__(self, name, address) + self.department = department + + def disp(self): + super(Manager, self).disp() # Employee,disp(self) + self.department = department + def disp(self): + super(Manager, self).disp() # Employee.disp(self) + print('Departman: {}'.format(self.department)) + +class Executive(Manager): + def __init__(self, name, address, department, region): + super(Executive, self).__init__(name, address, department) # Manager.__init__(self, name, address, department) + self.region = region + + def disp(self): + super(Executive, self).disp() # Manager.disp(self). + print('Bölge: {}'.format(self.region)) + +e = Executive('Salih Bulut', 'Kazlıçeşme', 'Üretim', "Ortadoğu") +e.disp() diff --git a/python-temel/company.2.py~ b/python-temel/company.2.py~ new file mode 100644 index 0000000..090081e --- /dev/null +++ b/python-temel/company.2.py~ @@ -0,0 +1,10 @@ +class Employee: + def __init__(self, name, address): + self.name = name + self.address = address + + def disp(self): + print('Adı Soyadı: {}'.format(self.name)) + print('Adres: {}'.format(self.address)) + +class Worker(Employee)