What does the is operator check for when comparing two variables in Python?
-
A
Value equality
-
B
Reference equality
Correct answer
-
C
Data type equality
-
D
Memory location equality
Correct answer
B. Reference equality
18 views
Explanation
The is operator checks whether two variables refer to the same object in memory.
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ