Say we got two lists:
a = [1, 2, 3]
b = [1, 2, 3]
All the following expressions will return True:
a == b # True
a == list(b) # True
a == list(tuple(b)) # True
a == copy.deepcopy(b) # still True
Here a and b are 2 different list objects with the same elements.
How do we distinguish one from another?
iscompares identity. It asks areaandbthe same object