Here is my code
a = [10,11,12]
index = [0,2]
print(a[index])
I expect 10,12 as output, but get error:
TypeError: list indices must be integers, not list
Is is possible to achive something like this in python? I know I can do it with list comprehension, but want something simpler. The problem looks so pythonic.