I saw there are several topics on removing items from a list, including using remove()
, pop()
, and del
. But none of these is what I am looking for, since I want to get a new list when the items are removed. For example, I want to do this:
a = [1, 2, 3, 4, 5, 6]
<fill in > # This step somehow removes the third item and get a new list b and let
b = [1, 2, 4, 5, 6]
How can I do this?