Well done!
You have completed Hierarchical and Multilevel Inheritance Quiz!
Quiz Question 1 of 5
Consider the following class definitions:
`class A: def init(self, attr1): self.attr1 = attr1
class B(A): def init(self, attr1, attr2): super().init(attr1) self.attr2 = attr2
class C(A): def init(self, attr1, attr3): super().init(attr1) self.attr3 = attr3
class D(B): def init(self, attr1, attr2, attr4): super().init(attr1, attr2) self.attr4 = attr4`
If you create an instance d = D(1, 2, 4)
, what attributes does d
have access to?
Choose the correct answer below: