Skip to content
Question 26 of 97

Q.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? (A) is (B) is not (C) and (D) or

Sikkim CbseCBSE Class XII Board 2025MCQ· 1mImportance★★★★★
27% · 26/97 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

The is operator in Python checks if two variables reference the exact same memory object (identity), not just equal values. The correct answer is (A) is.

The question tests your understanding of Python’s identity operators — is and is not. These are different from equality operators (== and !=). While == compares the value of two objects, is compares their identity — that is, whether they are the same object in memory.

Think of it like two people with identical names. == asks “Do they have the same name?” — yes, they do. is asks “Are they the same person?” — no, they are two different individuals. In Python, two variables can hold equal values but point to different memory locations (e.g., two separate lists with the same elements). The is operator returns True only when both variables refer to the exact same object.

Now let’s go through the options:

  1. Option (A): is

    This operator evaluates to True if the two operands refer to the same memory location (same object). For example:

    a = [1, 2, 3]
    b = a
    print(a is b)   # True — both point to the same list object
    

    This matches the description in the question exactly.

  2. Option (B): is not

    This is the negation of is. It returns True if the operands point to different memory locations. So it does the opposite of what the question asks.

  3. Option (C): and

    This is a logical operator that returns True only if both operands are truthy. It has nothing to do with memory location.

  4. Option (D): or …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.