Home  >  Article  >  Backend Development  >  How to use zip function in python

How to use zip function in python

高洛峰
高洛峰Original
2017-03-26 17:40:482139browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn