Test Index

CBSE Class 12 Computer Science 2025 Paper Set 4 Get it on Google PlayDownload on the App Store

© examsnet.com
Question : 7 of 37
Marks: +1, -0
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 ?
Solution:  
Concept:
Identity operators compare the memory location (object identity, id()) of two variables:
x is y is True when both refer to the same object.
x is not y is True when they refer to different objects.
Explanation:
>>> a = [1, 2]
>>> b = a
>>> c = [1, 2]
>>> a is b
True
>>> a is c
False
is matches the description exactly. is not works the opposite way, and and/or are logical operators.
Answer:
Option A (is)
© examsnet.com
Advertisements
Go to Question: