Why would the following two examples have different results? I thought slicing a list would result in a (shallow) copy of the list elements, so a should not be changed in both cases.
>>> a = [1, 2, 3, 4, 5]
>>> a[3: 5] = [0, 0] # example 1
>>> a
[1, 2, 3, 0, 0] # elements in the original list are changed
>>> b = a[3: 5] # example 2
>>> b = [100, 100]
>>> a # elements in the original list are unchanged
[1, 2, 3, 0, 0]