Sponsored Reserved space — layout preview until AdSense is connected

Zip two lists

Pair items from parallel lists and iterate them together.

7 lines 3 views 0 copies Updated May 23, 2026
Try in editor

How it works

zip(a, b) stops at the shorter sequence — handy when lists are the same length.

Unpack with for x, y in zip(...) or convert to a list of tuples for inspection.

Useful for combining names with scores, keys with values, or CSV columns.

Python
Try in editor
names = ["Ada", "Grace", "Katherine"]
scores = [98, 95, 100]

for name, score in zip(names, scores):
    print(f"{name}: {score}")

print(list(zip(names, scores)))

Sponsored

Sponsored Reserved space — layout preview until AdSense is connected

Run this sample

Open the browser IDE to tweak the example and see results without installing anything.

Open editor

More from Lists & loops