QuestionQ55

VerifiedObject-Oriented Programming

What is the expected output from the following code snippet?

Question Image

Explanation

An instance of Upper is not an instance of its subclass Lower, so isinstance(Object, Lower) returns False. The object uses Upper.method(), which returns upper; the space supplied by the first print separates the two values.

Community Discussion

No comments yet. Be the first to start the discussion!