QuestionQ129

VerifiedObject-Oriented Programming

Assuming the code below is stored in a file named code.py and runs successfully, which of the following expressions evaluate to True?

Question Image

Choose two
Explanation

When code.py is executed directly, both the module attribute recorded on a class defined in that file and the module’s __name__ value are __main__. ClassB directly inherits only from ClassA, and an instance of ClassA uses the default object string representation rather than returning Object.

Community Discussion

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