Skip to content

Commit 3afaa75

Browse files
authored
Add files via upload
1 parent 96e5667 commit 3afaa75

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

codes_in_Aug2025/OOPS/INHERITANCE/property decorator.py

Whitespace-only changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
class employee:
2+
company = "works in Microsoft"
3+
4+
def __init__(self):
5+
print("Employee class constructor.")
6+
7+
class coder(employee): # Inherits from employee
8+
language = "Python"
9+
company = "Works in Google" # Overriding the company attribute
10+
def __init__(self):
11+
print("Coder class constructor.")
12+
13+
def showlanguage(self):
14+
print(f"The language used is {self.language}.")
15+
16+
class manager(coder): # Inherits from both coder and employee
17+
name = "Trevor"
18+
19+
def __init__(self):
20+
super().__init__()
21+
print("Manager class constructor.")
22+
23+
def showname(self):
24+
print(f"The name of the manager is {self.name}.")
25+
26+
trevor = manager()

0 commit comments

Comments
 (0)