Iterate Through Two Lists in Parallel Python Using zip()

(Last Updated On: 27/03/2023)

Python Program to Iterate Through Two Lists in Parallel Using zip() Function

# Iterate Through Two Lists in Parallel Using zip() in python

list_1 = [1, 2, 5, 4]
list_2 = ['a', 'b', 'c']

# Using zip() method, you can iterate through two lists parallel as shown above.
for i, j in zip(list_1, list_2):
    print(i, j)

Output:

1 a
2 b
5 c

Leave a Reply

Your email address will not be published. Required fields are marked *