-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOOP6.py
More file actions
28 lines (26 loc) · 820 Bytes
/
Copy pathOOP6.py
File metadata and controls
28 lines (26 loc) · 820 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
27
28
#Passing member of one class to another class
class Employee:
def __init__(self,ename,eno,esal,ead):
self.ename=ename
self.eno=eno
self.esal=esal
self.ead=ead
def disp(self):
print("Name of the employee is: ",self.ename)
print("Number of employee is: ",self.eno)
print("Salary of Employee is: ",self.esal)
print("Employee address is: ",self.ead)
class Updation:
def Emp(emp):#it is refernce to created employee object
## print("Employee number is: ",emp.eno)
emp.esal=emp.esal+10000
## print("Updated salary of",emp.eno,"is: ",emp.esal)
emp.disp()
e1=Employee("Tejaswita",168,70000,"Bengluru")
e1.disp()
e2=Employee("Meera",123,50000,"Mumbai")
e2.disp()
Updation.Emp(e1)
Updation.Emp(e2)
##e1.disp()
##e2.disp()