-
Notifications
You must be signed in to change notification settings - Fork 0
/
inheritance.py
41 lines (38 loc) · 1.31 KB
/
inheritance.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
class princ:
def __init__(self,name,principal,circular) -> None:
self.name=name
self.position=principal
self.circular=circular
def msg(self,name,principal,circular):
print(self.name)
print(self.position)
print(self.circular)
class teacher(princ):
def __init__(self,name,principal,circular) -> None:
self.name=name
self.position=principal
self.circular=circular
print(self.name)
print(self.position)
print(self.circular)
class student(teacher):
def __init__(self,name,principal,circular) -> None:
self.name=name
self.position=principal
self.circular=circular
print(self.name)
print(self.position)
print(self.circular)
class parents(student):
def __init__(self,name,principal,circular) -> None:
self.name=name
self.position=principal
self.circular=circular
print(self.name)
print(self.position)
print(self.circular)
a=princ("MURUGESAN","PRINCIPAL","MONDAY IS FULL WORKING DAY")
b=teacher("MURUGESAN","PRINCIPAL","MONDAY IS FULL WORKING DAY")
c=student("MURUGESAN","PRINCIPAL","MONDAY IS FULL WORKING DAY")
d=parents("MURUGESAN","PRINCIPAL","MONDAY IS FULL WORKING DAY")
a.msg("MURUGESAN","PRINCIPAL","MONDAY IS FULL WORKING DAY")