This article mainly introduces the use of zip function in python in detail, which has certain reference value. Interested friends can refer to it
zip FunctionLink name/value lists together
In [1]: names = ['name', 'age', 'pay', 'job']
In [ 2]: values = ['Sue Jones', 45, 40000, 'hdw']
In [3]: a = zip(names, values)
In [4]: a
Out[4]: [('name', 'Sue Jones'), ('age', 45), ('pay', 40000), ('job', 'hdw')]
The above is the detailed content of How to use zip function in python. For more information, please follow other related articles on the PHP Chinese website!