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

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -