QuestionQ19

VerifiedAdvanced Object-Oriented Programming

Which function or operator should be used to get a True or False answer to the question, “Do two variables refer to the same object?”

Explanation

The is operator performs an object-identity comparison and evaluates to True exactly when both variables refer to the same object. The == operator instead tests equality of values.

Learn more

Community Discussion

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