So I've got into trouble when I want to delete a sequence of index from a list
for i in linked_node:
del l[i]
the linked_node is the index sequence this code simply wont work cause del changed the size of the list
using a for loop , I can do this by appending them to a new list
l1 = []
for i in range(len(l)):
if i is not in linked_node:
l1.append(l[])
my question is , how to do this in an elegent way?without creating another list
land are deleting while looping over it (which won't work without creating a copy) or you are looping over a list of indices.