a == c: This checks if the values of a and c are equal. The values of both lists are [1, 2, 3], so a == c is True.
a is c: This checks if a and c refer to the exact same object. As mentioned before, although the values of the lists are the same, a and c are two different list objects. Therefore, a is c is False.
So, the output of this code will be: True, False
0 Comments:
Post a Comment