Re: Removing items from a list simultaneously

2009-04-20 Thread Steven D'Aprano
On Mon, 20 Apr 2009 20:09:12 -0700, Ross wrote: > Is there a quick way to simultaneously pop multiple items from a list? > For instance if i had the list a = [1,2,3,4,5,6,7] and I wanted to > return every odd index into a new list, my output would be new_list = > [2,4,6] or similarly if I wanted t

Removing items from a list simultaneously

2009-04-20 Thread Ross
Is there a quick way to simultaneously pop multiple items from a list? For instance if i had the list a = [1,2,3,4,5,6,7] and I wanted to return every odd index into a new list, my output would be new_list = [2,4,6] or similarly if I wanted to return each index that was one away from the midpoint i