Pair items at the same position in each input as you loop.
Syntax
zip(*iterables, strict=False)Parameters
| Name | Description |
|---|---|
iterablesIterable | Values to combine. Dictionaries contribute keys. Optional · Variadic No default |
strictBoolean | False: stop at the shortest input. True: raise an error while reading if input lengths differ. Pass by name. Optional · Keyword only Default: False |
Returns
zip — A one-use iterator of tuples, each containing one item per input. Use list(result) to keep the tuples.Example
# Pair labels with click points
labels = ["left", "right"]
points = [Point(100, 500), Point(900, 500)]
for pair in zip(labels, points):
text(pair[0])
click(pair[1])