If `L.append(5)` grows your list, why does `L = L.append(5)` silently destroy it?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
The list colors starts as ["red", "green"]. Add the string "blue" to the end so colors becomes the three-item list ["red", "green", "blue"]. Mutate it in place — do not reassign colors to whatever the call returns.
Hint: append adds one item to the end of a list.
The L.append(element) form
Write the form naming the object before the dot, the function and the parameter, then trace L = [2, 1, 3] with L.append(5) to the four-element [2, 1, 3, 5].
The L = L.append(5) mistake
Record what each side of L = L.append(5) evaluates to, ending with the name L bound to None, and write the correct version as two bare L.append(5) lines.
One object per call, used for its side effect
State that append adds exactly one object, itself possibly a list, then trace L1 = ["re"], L2 = ["mi"], L3 = ["do"], L4 = L1 + L2, L3.append(L4), L = L1.append(L3).