We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9702948 commit 96e5667Copy full SHA for 96e5667
1 file changed
codes_in_Aug2025/OOPS/INHERITANCE/multiple_inheritance.py
@@ -0,0 +1,25 @@
1
+class employee:
2
+ company = "Microsoft"
3
+
4
+ def __init__(self, name):
5
+ self.name = name
6
7
+ def info(self):
8
+ print(f"The name of the employee is {self.name}. He is in the company: {self.company}.")
9
10
+class coder:
11
+ language = "Python"
12
13
+ def showlanguage(self):
14
+ print(f"The language used is {self.language}.")
15
16
+class programmer(employee, coder): # Inherits from employee and coder ------ Derived class
17
+ company = "Google" # Overrides class variables
18
+ language = "Java"
19
20
+bob = employee("Bob")
21
+bob.info()
22
23
+alice = programmer("Alice")
24
+alice.info()
25
+alice.showlanguage()
0 commit comments