SyntaxFix
Write A Post
Hire A Developer
Questions
A functional approach:
a = [1,"A", 34, -123, "Hello", 12] b = [0, 2, 5] from operator import itemgetter print(list(itemgetter(*b)(a))) [1, 34, 12]