-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3.py
More file actions
26 lines (18 loc) · 655 Bytes
/
3.py
File metadata and controls
26 lines (18 loc) · 655 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class Worker():
income = {'wage': 100, 'bonus': 20}
def __init__(self, name, surname, position):
self.name = name
self.surname = surname
self.position = position
class Position(Worker):
def __init__(self, name, surname, position):
super().__init__(name, surname, position)
def get_full_name(self):
print(f'{self.name} {self.surname}')
def get_total_income(self):
res = self.income['wage']*self.income['bonus']
print(f' full income {res}')
pos = Position('Виктор', 'Петров', 'Програмист')
pos.get_full_name()
pos.get_total_income()
print(pos.income)