zip stops at the shortest iterable
@nathansl-cell▲ 5 net votes
zip([1, 2, 3], 'ab') gives two pairs. Use itertools.zip_longest or, in 3.10+, zip(..., strict=True) to catch mismatches.
5 COMMENTS
Stellar
First-rate
Straightforward
Fundamental
Actionable