Consider multiple inheritances here. Suppose class c inherits from classes a and b as class c(a,b). Classes a and b both have their own versions of method func(). If we call func() from an object of class c, which version gets invoked?



Consider multiple inheritances here. Suppose class c inherits from classes a and b as class c(a,b). ..

Answer / Sudhanshi Shukla

In case of method resolution order (MRO), the method from the first parent class that is encountered during the MRO will be invoked. The MRO for multiple inheritance can be found using `class_name.__mro__`.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

Is python case-sensitive?

4 Answers  


How many items are in a list python?

1 Answers  


Name the arithmetic operators supported by python.

1 Answers  


What is the cost of python certification?

1 Answers  


What is a raw string in python?

1 Answers  


What is metadata in python?

1 Answers  


What is a negative index in python?

1 Answers  


What are negative indexes?

1 Answers  


Explain how to copy an object in Python.

1 Answers  


Why is button parameter “command” executed when declared?

1 Answers  


How to run script in python?

1 Answers  


What is flatmap in python?

1 Answers  


Categories