在Python中怎样迭代多个序列?

比如有两个序列
a=[12,253,63,42,42,8,6]
b=[454,5692,41,144,12,12]
那么现在,,怎么同时对a和b两个序列进行迭代?
已邀请:

七月 - 喵=w=

推荐来自: Manjusaka ufo5260987423 氪星人 刘若衡 山人 高衍 phantom更多 »

for x, y in zip(a, b):
print x + y # some operation here
可以用zip把两个list串到一起~

要回答问题请先登录注册