gs gs109 Python OOPs - Python Inheritance - Quiz No.1

gs gs109 Python Quiz

Online Quizzes Preparation

This quiz belongs to book/course code gs gs109 Python of gs organization. We have 134 quizzes available related to the book/course Python. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Python OOPs. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.

NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.

Question 1: Which of the following best describes inheritance?
Question 2: Which of the following statements is wrong about inheritance?
Question 3: What will be the output of the following Python code?

 class Demo: def __new__(self): self.__init__(self) print("Demo's __new__() invoked") def __init__(self): print("Demo's __init__() invoked") class Derived_Demo(Demo): def __new__(self): print("Derived_Demo's __new__() invoked") def __init__(self): print("Derived_Demo's __init__() invoked") def main(): obj1 = Derived_Demo() obj2 = Demo() main() 
Question 4: What will be the output of the following Python 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() 
Question 5: What will be the output of the following Python code?

 class A(): def disp(self): print("A disp()") class B(A): pass obj = B() obj.disp() 


Online Quizzes of gs109 Python

Other LANG related online quizzes

Other categories of gs Online Quizzes

Other organizations

Theme Customizer

Gaussian Texture



Gradient Background