We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 96e5667 commit 3afaa75Copy full SHA for 3afaa75
2 files changed
codes_in_Aug2025/OOPS/INHERITANCE/property decorator.py
codes_in_Aug2025/OOPS/INHERITANCE/super_method.py
@@ -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
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
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