zip() Function to take iteratable objects as parameters , Package the corresponding elements in the object into tuples , Then return a list of these tuples .
If the number of elements in each iterator is inconsistent , Returns a list of the same length as the shortest object , utilize * The operator , Tuples can be unzipped into lists .
if __name__ == '__main__':
a = [1, 2, 3]
b = ['1', '2', '3']
c = zip(a, b)
for d in c:
print(d)
e = [1, 2, 3, 4]
# When the length is different , Whichever is shorter
f = zip(a, e)
for g in f:
print(g)
h = zip(*f)