Explanation:
๐น Step 1: Create First List
a = []
Python creates a NEW empty list object.
Visual:
a ───> []
๐น Step 2: Create Second List
b = []
Python creates ANOTHER new empty list.
Visual:
a ───> []
b ───> []
⚠️ Important:
Even though lists look same,
they are DIFFERENT objects in memory ๐
๐น Step 3: Execute a is b
a is b
๐งฉ What is Checks
is checks:
Are both variables pointing to SAME object?
NOT:
Do values look same?
๐น Step 4: Compare Memory Identity
Here:
a → first list object
b → second list object
Different objects ❌
So:
a is b → False
๐น Step 5: Print Result
print(False)
๐ Final Output:
False

0 Comments:
Post a Comment