How to aggregate elements from two lists in Python

1 Answer

0 votes
lst1 = [1, 2, 3, 4]
lst2 = [5, 6, 7, 8]

zipped = zip(lst1, lst2)

print(list(zipped))

'''
run:
 
[(1, 5), (2, 6), (3, 7), (4, 8)]

'''

 



answered Nov 21, 2018 by avibootz
...