Bird
0
0

What does the is operator check in Python?

easy📝 Conceptual Q11 of 15
Python - Operators and Expression Evaluation
What does the is operator check in Python?
AIf two variables are of the same type
BIf two variables have the same value
CIf two variables point to the same object
DIf two variables are both numbers
Step-by-Step Solution
Solution:
  1. Step 1: Understand the is operator

    The is operator checks whether two variables refer to the exact same object in memory.
  2. Step 2: Differentiate from equality

    Unlike ==, which checks if values are equal, is checks identity, meaning the same object.
  3. Final Answer:

    If two variables point to the same object -> Option C
  4. Quick Check:

    is checks object identity = C [OK]
Quick Trick: Remember: is means same object, not just equal value [OK]
Common Mistakes:
MISTAKES
  • Confusing is with ==
  • Thinking is checks value equality
  • Assuming is works like type comparison

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes