I thought I had the whole list alias thing figured out, but then I came across this:
l = [1, 2, 3, 4] for i in l: i = 0 print(l) <
l = [1, 2, 3, 4] for i in l: i = 0 print(l)
When you say i = 0 you assign a new value to the variable i.
i = 0
i
When you say i[0] = 0 you modify the list in variable i, setting the first element to a new value. Since the list in i is an element of l, l ends up with modified elements.
i[0] = 0
l