SyntaxFix
Write A Post
Hire A Developer
Questions
You're after the zip function.
Taken directly from the question: How to merge lists into a list of tuples in Python?
>>> list_a = [1, 2, 3, 4] >>> list_b = [5, 6, 7, 8] >>> zip(list_a,list_b) [(1, 5), (2, 6), (3, 7), (4, 8)]