QuestionQ93

VerifiedObject-Oriented Programming

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

Question Image

Choose two
Explanation

Assigning self.prop = self.var = value creates the instance attributes prop and var. Thus, Object.__dict__ contains exactly those two keys, including var. The class attribute data remains in Class.__dict__, not Object.__dict__.

Community Discussion

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