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)]
原文地址:https://www.cnblogs.com/botoo/p/7368153.html