QuestionQ115

VerifiedObject-Oriented Programming

What behavior is expected from the following code?

Question Image

Explanation

Augmented assignment to object_1.Variable creates or updates an instance attribute and does not change the class attribute used by object_2. object_1.value remains 0, so the printed expression evaluates to 0 + 0, which is 0.

Community Discussion

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