python-CSD-kursu/python-temel/company.2.py

42 lines
1.5 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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()