ID EN
Itertools

starmap

Python 3.11

Make an iterator that computes the function using arguments obtained from the iterable. Used instead of map() when argument parameters are already grouped in tuples from a single iterable (when the data has been “pre-zipped”).

Syntax

PYTHON
itertools.starmap(function, iterable)

Examples

Example 1
PYTHON
def starmap(function, iterable):
     starmap(pow, [(2,5), (3,2), (10,3)]) --> 32 9 1000
    for args in iterable:
        yield function(*args)

See Also

map() map() starmap()