python中zip同时循环两个可迭代对象

 

>>> test1 = [100,300,500,1000]
>>> test2 = [350,550,300,350]
>>> for i in zip(test1,test2):
    i[0] + i[1]

    
450
850
800
1350

 

posted @ 2021-01-01 19:03  小鲨鱼2018  阅读(382)  评论(0编辑  收藏  举报