Home > Backend Development > Python Tutorial > How to use zip function in python

How to use zip function in python

高洛峰
Release: 2017-03-26 17:40:48
Original
2199 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template