-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathempmgr.py
50 lines (40 loc) · 1.13 KB
/
empmgr.py
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
42
43
44
45
46
47
48
49
50
from employee import Employee
lst_emp=[]
def load_emp():
with open("empdata.txt") as f:
fdata=f.readlines()
for data in fdata:
edata=data.strip("\n").split(",")
empno=int(edata[0])
ename=edata[1]
qual=edata[2]
salary=int(edata[3])
dept_name=edata[4]
emp=Employee(empno,ename,qual,salary,dept_name)
lst_emp.append(emp)
print(f"total Employee count:{len(lst_emp)}")
def showDeptName():
dept_name=set(map(lambda emp:emp.dept_name,lst_emp))
for name in dept_name:
print(name)
def showAllQualifications():
qual=set(map(lambda emp:emp.qual,lst_emp))
for qual in qual:
print(qual)
def maxSalaryEmp():
max_salary=max(list(map(lambda x:x.salary,lst_emp)))
lst=list(filter(lambda x:x.salary==max_salary,lst_emp))
for emp in lst:
emp.show_info()
def showEmpCountByDeptName():
pass
def showTotalSalByDeptName():
pass
def showEmpCountByQual():
pass
load_emp()
print("all department names:")
showDeptName()
print("all qualifications:")
showAllQualifications()
maxSalaryEmp()