Look at the following code:
a = [1, 2, 3]
# a is a reference to an object of type 'list'
b = [1, 2, 3]
# b is a reference to an object of type 'list'
print(a is b)
Output: False
a = (1, 2, 3)
# a is a reference to an object of type 'tuple'
b = (1, 2, 3)
# b is a reference to an object of type 'tuple'
print(a is b)
Output: True
Why is the output different in both cases? Has a mutable or an immutable structure got something to do with it?