Welcome, guest | Sign In | My Account | Store | Cart

This code lets you retrieve multiple elements from a list at one time

Python, 1 line
1
getVar = lambda searchList, ind: [searchList[i] for i in ind]

Example:

>>> getVar([1,2,3,4,5],[0,3])
[1, 4]