I have the following Python list (can also be a tuple):
myList = [\'foo\', \'bar\', \'baz\', \'quux\']
I can say
>>&g
Maybe a list comprehension is in order:
L = ['a', 'b', 'c', 'd', 'e', 'f'] print [ L[index] for index in [1,3,5] ]
Produces:
['b', 'd', 'f']
Is that what you are looking for?