We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3a0fde commit 03bed6aCopy full SHA for 03bed6a
1 file changed
prep_exercises/exercise9inheritance.py
@@ -46,4 +46,8 @@ def get_full_name(self) -> str:
46
#Traceback (most recent call last):
47
# File "/Users/Module-Decomposition/prep_exercises/exercise9inheritance.py", line 34, in <module>
48
# print(person2.get_full_name())
49
-#AttributeError: 'Parent' object has no attribute 'get_full_name'
+#AttributeError: 'Parent' object has no attribute 'get_full_name'
50
+
51
+#This error on the last line means since there is no method called get_full_name in Parent class(it is only defined in child),
52
+#python rises the attribute error on parent and inheritance works downward so the child can have what the parent have but not the reverse.
53
+#and hence get_full_name is only for the child and it can not be inherited to the parenet.
0 commit comments