9fc6be8724
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com> |
||
---|---|---|
.. | ||
README.md |
zip
{:.no_toc}
* TOC {:toc}Top
Questions to David Rotermund
zip
zip(*iterables, strict=False)
Iterate over several iterables in parallel, producing tuples with an item from each one.
a = zip([1, 2, 3], ["sugar", "spice", "everything nice"])
print(a) # -> <zip object at 0x7f34987f4380>
for item in zip([1, 2, 3], ["sugar", "spice", "everything nice"]):
print(item)
Output:
(1, 'sugar')
(2, 'spice')
(3, 'everything nice')