operator.itemgetter: Get Multiple Items From a List or Dictionary
Table of Contents
operator.itemgetter: Get Multiple Items From a List or Dictionary
Normally, to access multiple indices from a list, you need to use list comprehension. To do the same thing with simpler syntax, use operator.itemgetter instead.