If two list are equivalent, is it necessary that they are identical also. Explain with an example.
Question :
If two list are equivalent, is it necessary that they are identical also. Explain with an example.
>>> a = [ 2, 4, 6 ]
>>> b = [2, 4, 6 ]
>>> a is b
False
Above two lists are equivalent, because they have the same elements, but not identical, because they are not the same object. If two objects are identical, they are also equivalent, but if they are equivalent, they are not necesarily identical.