zip()
Iterates over two sequences in parallel.
Syntax
for a, b in zip(array1, array2):
Description
Matches up multiple sequences simultaneously, giving (a, b) pairs. It stops when the shortest sequence runs out.
Example
Loading editor…
Expected output
Alex 95 Linus 88
When to use?
Processing two lists together (name+score, key+value).