Tips : The way to set pairs from iterations in match of index.

2028 ワード

returns zip object
list_a = [1,2,3]
list_b = [4,5,6]
tup_a = ('a','b','c')
tup_b = ('d','e','f')

for pair in zip(list_a, list_b, tup_a, tup_b):
    print(pair)
(1, 4, 'a', 'd')
(2, 5, 'b', 'e')
(3, 6, 'c', 'f')