python - Remove element from list without side-effect -
how remove specific index list without side-effect? is, using:
l = [1,2,3,4] del l[2] is not alternative, still want keep l intact. there neater way doing deep copy , remove value there?
slice list:
l = [1,2,3,4] l[:2] + l[3:] [1, 2, 4]
Comments
Post a Comment