-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path09EmplDeptManagement.py
64 lines (53 loc) · 1.65 KB
/
09EmplDeptManagement.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
51
52
53
54
55
56
57
58
59
60
61
62
63
class Employee:
__id=0
__name=""
__gender=""
__city=""
__salary=0
__dept_id=0
def setEmployeeData(self):
self.__id = int(input("Enter Id:\t"))
self.__name = input("Enter Name:\t")
self.__gender = input("Enter Gender:\t")
self.__city = input("Enter City:\t")
self.__salary = int(input("Enter Salary:\t"))
self.__dept_id = int(input("Enter Department Id:\t"))
def showEmployeeData(self):
print("Id\t\t:",self.__id)
print("Name\t:", self.__name)
print("Gender\t:", self.__gender)
print("City\t:", self.__city)
print("Salary\t:", self.__salary)
print("Department I\t:",self.__dept_id)
employees = list(());
#print(employees)
print("Enter Employee Details")
for i in range(1):
#print(i);
employee=Employee()
employee.setEmployeeData()
employees.append(employee)
for employee in employees:
employee.showEmployeeData();
class Department:
__id=0
__name=""
__emp_count=0
def setDepartmentData(self):
self.__id = int(input("Enter Id:\t"))
self.__name = input("Enter Name:\t")
self.__emp_count = int(input("Enter Employee Count:\t"))
def showDepartmentData(self):
print("Id\t\t:",self.__id)
print("Name\t\t:", self.__name)
print("Employee Count\t:",self.__emp_count)
departments = list(());
#print(employees)
print("\n\n Enter Department Details\n")
for i in range(1):
#print(i);
department=Department()
department.setDepartmentData()
departments.append(department)
for department in departments:
department.showDepartmentData();