delete items from list by indices

blumenkraft vohsrea at gmail.com
Wed Sep 23 04:25:52 EDT 2009


Hi,

I have some list:
x = [8, 9, 1, 7]
and list of indices I want to delete from x:
indices_to_delete = [0, 3], so after deletion x must be equal to [9,
1].

What is the fastest way to do this? Is there any builtin?

Thanks.



More information about the Python-list mailing list