Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
In a = [1, 2] and b = [1, 2], a == b is True and a is b is False but could someone please explain how a == [1, 2] returns True
a = [1, 2]
b = [1, 2]
a == b
a is b
a == [1, 2]
id
is
==
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
idof both the variables. You will get your answer forisand==only checks the elements in the list