Python‎ > ‎itertools‎ > ‎

itertools.starmap()


Definition
Return an iterator whose values are returned from the function evaluated with a argument tuple taken from the given sequence.

Syntax
starmap(function, sequence) --> starmap object

Parameters
Function and sequence

Example
The return is:
from itertools import *
list = [("Python", "Lake"), ("Adil", "Waseem")]
for i in starmap(lambda x,y:(x, y, x+y), list):
print( i)

>>> 
('Python', 'Lake', 'PythonLake')
('Adil', 'Waseem', 'AdilWaseem')
>>>

Comments