Oct 25, 2024
pop
: Removes and returns an element.insert
: Inserts a new value at a specified index.append
and extend
.0
removes the first element and shifts other elements left.IndexError
.foo
at index 0
shifts existing elements to the right.append
.[2, 4, 6, 8, 10]
A
and C
point to the same list, demonstrating shared changes.10
which was at the end.0
removes 2
, shifting other elements.foo
at index 0
shifts existing elements to accommodate the new element.bar
at the end appends it without shifting other elements.bar
at the end.