-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeveloper.py
More file actions
41 lines (33 loc) · 1.18 KB
/
developer.py
File metadata and controls
41 lines (33 loc) · 1.18 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class Developer:
def __init__(self, line):
line_content = line.rstrip().split(' ')
self.ci = line_content[0]
self.bi = int(line_content[1])
self.num_s = int(line_content[2])
self.skills = set(line_content[3:])
self.sit = None
def toString(self):
return f"Company: {self.ci} | Bonus: {self.bi} | Skills: {self.skills}"
def compareDev(self, person):
try:
common = len(self.skills.intersection(person.skills))
diff = len(self.skills.union(person.skills)) - common
work_score = common * diff
bonus_score = self.bi * person.bi
return work_score + bonus_score
except:
return self.bi * person.bi
def setSit(self, sit):
self.sit = sit
class Manager:
def __init__(self, line):
line_content = line.rstrip().split(' ')
self.ci = line_content[0]
self.bi = int(line_content[1])
self.sit = None
def compareDev(self, person):
return self.bi * person.bi
def setSit(self, sit):
self.sit = sit
def toString(self):
return f"Company: {self.ci} | Bonus: {self.bi}"