python基础===zip在python3中的用法

name=["ad","kein","tom"]
age=[23,45,22]
tel=['157','139','167']

print(list(zip(name,age,tel)))

test=[1,2]

print(list(zip(name,age,tel,test)))

>>> 
[('ad', 23, '157'), ('kein', 45, '139'), ('tom', 22, '167')]
[('ad', 23, '157', 1), ('kein', 45, '139', 2)]

 

posted @ 2017-08-15 22:31  AAA五金批发王建军  阅读(203)  评论(0编辑  收藏  举报