List Reference
a = [
1, 2, 3, 4
]
b = a
b
[1, 2, 3, 4]
b.append(5)
a
[1, 2, 3, 4, 5]
As b is referring to a, whatever is added to b, will be reflected to a as well
If you don’t want such behavior, just use .copy() or a[:]
c = a.copy()
c.append(6)
a
[1, 2, 3, 4, 5]