Deleting multiple elements from a list
list, python
Solution
You can use `enumerate` and remove the values whose index matches the indices you want to remove:
indices = 0, 2
somelist = [i for j, i in enumerate(somelist) if j not in indices]
Problem
Is it possible to delete multiple elements from a list at the same time? If I want to delete elements at index 0 and 2, and try something like `del somelist[0]`, followed by `del somelist[2]`, the second statement will actually delete `somelist[3]`. I suppose I could always delete the higher numbered elements first but I'm hoping there is a better way.