QuestionQ70

VerifiedObject-Oriented Programming

Assuming the following code has executed successfully, which expressions evaluate to True?

Question Image

Choose two
Explanation

Chained assignment in a class body creates both var and data as attributes of Class, so 'var' in Class.__dict__ and 'data' in Class.__dict__ are true. A class dictionary also includes automatically supplied entries such as __module__, __dict__, and __doc__, and Object.__dict is not the special __dict__ attribute name.

Community Discussion

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