eval.in

Paste #931424

Python — CPython 3.4.1, pasted 1 year ago (json)

1
2
3
4
5
6
7
8
A = [(100,250), (34,78), (1,2)]
S = [2,0,1]

from operator  import itemgetter

r = itemgetter(*S)(A)

print (r)

Program Output

((1, 2), (100, 250), (34, 78))

OK (0.068 sec real, 0.078 sec wall, 8 MB, 45 syscalls)

Fork