The zip function is used when you want to retrieve elements from different lists at the same time.
for alpha, kana in zip(["a","b","c"],["Ah","I","U"]):
print(alpha, "and", kana)
Execution result 1
a and a
b and i
c and u
a = [1,2,3]
b = [11,12,13]
c = list(zip(a,b))
c
Execution result 2
[(1, 11), (2, 12), (3, 13)]
Recommended Posts