Advertisements
Advertisements
Question
Which of the following operator evaluates to True if the variable on either side of the operator points towards the same memory location and False otherwise?
Options
isis notandor
MCQ
Advertisements
Solution
is
Explanation:
The is operator checks identity, not value. It returns True if both variables refer to the same memory location, and False otherwise.
is→ same object in memoryis not→ different objects in memoryand,or→ logical operators, not identity checks
Hence, the correct option is is.
shaalaa.com
Is there an error in this question or solution?
