Share Your Feedback

Inheritance in Python - True or False Questions with Answers

Test your understanding of Object-Oriented Programming (OOP) in Python with these carefully crafted True or False questions on Inheritance. Great for beginners and intermediate learners to reinforce OOP concepts.

๐Ÿ” True or False

๐ŸŸข Beginner

  1. In Python, a child class can inherit from only one parent class.
  2. Answer

    โŒ False โ€“ Python supports multiple inheritance, allowing a child class to inherit from multiple parent classes.


  3. The `super()` function is used to call a method from a parent class.
  4. Answer

    โœ… True โ€“ The `super()` function allows access to methods from a parent class, especially useful in method overriding.


  5. Method overriding allows a subclass to provide a specific implementation of a method already defined in its parent class.
  6. Answer

    โœ… True โ€“ Method overriding lets a subclass define its own version of a method inherited from the parent class.


  7. In Python, private attributes (prefixed with double underscores) are directly accessible in subclasses.
  8. Answer

    โŒ False โ€“ Private attributes are name-mangled and not directly accessible in subclasses.


  9. The `__init__` method is automatically called when a new object of a class is instantiated.
  10. Answer

    โœ… True โ€“ The `__init__` method initializes the object's state upon creation.


๐ŸŸก Intermediate

๐Ÿ”ด Advanced

๐Ÿ“š Related Resources


๐Ÿง  Practice & Progress

Explore More Topics

๐Ÿฃ Python for Beginners

๐Ÿง  Python Advanced