0 of 6 questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 6 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
You have the potential to do better! 🙂
If you found a concept confusing on this page then please leave a comment below asking for clarity.
Try re-reading the tutorial on this page before you retake this quiz!
Good work on clearing this quiz!
Outstanding work! You have mastered this lesson. Onward to the next one!
Which of the following best describes inheritance?
Which of the following statements is wrong about inheritance?
What is the output of the following piece of code?
class Test:
   def __init__(self):
       self.x = 0
class Derived_Test(Test):
   def __init__(self):
       self.y = 1
def main():
   b = Derived_Test()
   print(b.x, b.y)
Â
main()
What is the output of the following piece of code?
class A():
   def disp(self):
       print(“A disp()”)
class B(A):
   pass
obj = B()
obj.disp()
Suppose B is a subclass of A.
There is a test() method defined in A. How can you call this method from B? what is the line of code you should write inside B’s definition?
Suppose B is a subclass of A.
There is an attribute “hyper = 0” defined in A. How can you refer to this attribute from B and change its value to 1? what is the line of code you should write inside B’s definition?