Question

In Python, if a method in a subclass has the same name as a method in its superclass, which method will be called when invoked on an object of the subclass?

A The superclass method, unless explicitly called with `super()`.
B Both methods will be called.
C The subclass method, overriding the superclass method.
D A `TypeError` will be raised.
E The choice depends on the order of inheritance.
Practice Next

Hey! Ask a query