The zip() Function for Pairing Iterables in Python


Combine elements from two or more iterables into tuples.

Source Code

names = ["John", "Jane"]
ages = [30, 25]
for name, age in zip(names, ages):
    print(f"{name} is {age} years old")
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments