Name
zip
Synopsis
zip(seq
,*seqs
)
Returns a list of tuples, where the n
th
tuple contains the n
th element from each
of the argument sequences. zip
is called with
n
iterable objects as arguments (where
n
is greater than 0
).
If the iterable objects have different lengths,
zip
returns a list as long as the shortest
iterable, ignoring trailing items in the other iterable objects. See
also map
in this section.
Get Python in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.