You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Sample_Inheritence.py
+10-4
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
# and try to analyze the inheritence behaviour of the sub-class.
3
3
4
4
importdatetime
5
-
5
+
#------------------------------------------------------------------------- PARENT CLASS EMPLOYEE -------------------------------------------------------------------
self.pay=self.pay*self.raise_amount# Every class variable is accessed using the class name
32
+
self.pay=self.pay*Employee.raise_amount# Every class variable is accessed using the class name
32
33
returnself.pay
33
34
34
35
@classmethod
@@ -42,6 +43,8 @@ def is_weekday(day):
42
43
ifday.weekday() ==5orday.weekday() ==6:
43
44
returnFalse
44
45
returnTrue
46
+
47
+
#------------------------------------------------------------------ Child Class Developer --------------------------------------------------------------------------
0 commit comments