Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What is inheritance?

View

Which class is considered the parent class in inheritance?

View

How do you call a parent class’s constructor from a child class?

View

What kind of inheritance is this?

View

How many parent classes can a class have in Python?

View

What is the output of this code?

View

Which function checks if an object is an instance of a class?

View

What is the output of this code?

View

How do you prevent a class from being inherited?

View

What happens if a child class does not override a parent class method?

View

What is inheritance?

Creating objects from classes
Accessing private attributes
Deriving a class from another class
Hiding methods from other classes

Which class is considered the parent class in inheritance?

The class that is inherited
The class that inherits another class
Any class that has methods
A class that contains abstract methods

How do you call a parent class’s constructor from a child class?

super().init()
super().__init__()
this().__init__()
parent.__init__()

What kind of inheritance is this?

class A: pass class B(A): pass class C(B): pass

Single Inheritance
Multilevel Inheritance
Multiple Inheritance
Hybrid Inheritance

How many parent classes can a class have in Python?

Only one
Two
Any number
Zero

What is the output of this code?

class A: def show(self): print("A") class B(A): def show(self): print("B") b = B() b.show()

A
B
A B
Error

Which function checks if an object is an instance of a class?

instanceof()
is()
isinstance()
isclass()

What is the output of this code?

class A: pass class B: pass class C(A, B): pass print(issubclass(C, A))

True
False
None
Error

How do you prevent a class from being inherited?

Use the @final decorator
Use private class
Python does not support this feature
Set the class attributes to private

What happens if a child class does not override a parent class method?

It raises an error
The parent’s method is used
It executes without any output
The method is skipped