Why does only the first tuple change in example II whereas both lists get changed in example I? Please consider these two programs and their respective output (I and II).
I.
L1 = [1,2,3,4]
L2 = L1
L2.append(5)
print("L1: ", L1)
print("L2: ", L2)
Output:
L1: [1,2,3,4,5]
L2: [1,2,3,4,5]
II.
L1=(1,2,3,4)
L2=L1
L2 += (5,)
print("L1: ", L1)
print("L2: ", L2)
Output:
L1: (1,2,3,4)
L2: (1,2,3,4,5)