In Python I have a list of elements aList and a list of indices myIndices. Is there any way I can retrieve all at once those items in aList
aList
myIndices
Alternatively, you could go with functional approach using map and a lambda function.
>>> list(map(lambda i: aList[i], myIndices)) ['a', 'd', 'e']