Question 1 of 25
Hints left: 3
Q1
What is the benefit of using inheritance in object-oriented programming?
Q2
What is an object in the context of object-oriented programming?
Q3
Which principle of OOP emphasizes the bundling of data and methods that operate on the data into a single unit?
Q4
What does built-in function help do in context of classes?
Q5
What will be the output of the following Python code? >>> class A: pass >>> class B(A): pass >>> obj=B() >>> isinstance(obj,A)
Q6
What is the purpose of using abstraction in object-oriented programming?
Q7
What is polymorphism in object-oriented programming?
Q8
Which of the following statements is wrong about inheritance?
Q9
Which of the following best describes inheritance?
Q10
What is the biggest reason for the use of polymorphism?
Q11
Which principle of OOP promotes the reusability of code and allows a class to inherit properties and methods from another class?
Q12
What is a class variable in object-oriented programming?
Q13
What is the purpose of the constructor (__init__ method) in a class in Python?
Q14
Which of the following best describes polymorphism?
Q15
Which of the following is not a type of inheritance?
Q16
What is the purpose of abstraction in object-oriented programming?
Q17
What is the difference between a class and an object in object-oriented programming?
Q18
What does encapsulation refer to in object-oriented programming?
Q19
What is the use of duck typing?
Q20
What does built-in function type do in context of classes?
Q21
What will be the output of the following Python code? class Demo: def __init__(self): self.x = 1 def change(self): self.x = 10 class Demo_derived(Demo): def change(self): self.x=self.x+1 return self.x def main(): obj = Demo_derived() print(obj.change()) main()
Q22
What will be the output of the following Python code? class A: def __str__(self): return '1' class B(A): def __init__(self): super().__init__() class C(B): def __init__(self): super().__init__() def main(): obj1 = B() obj2 = A() obj3 = C() print(obj1, obj2,obj3) main()
Q23
What is a class in the context of object-oriented programming?
Q24
Which of the following statements isn't true?
Q25
What does single-level inheritance mean?