LEVEL 5Identity & membership
PYTHON, PLOT TWIST! Q41
Identity vs equality
What’s the output? Think first. Trust your brain.
question_41.pyPython 3
1a = [1, 2, 3]2b = [1, 2, 3]3c = a4print(a == b)5print(a is b)6print(a is c)7print(a is not b)
Same content. Different home.

Equality ≠ identity.
a very python moment