两个列表引索相同元素相加
listA = [1,2,3,4] listB = [8,7,6,5] listC = list(zip(listA,listB)) print(listC) listD = [x+y for x ,y in listC] print(listD)
posted on 2020-04-25 17:00 __director 阅读(219) 评论(0) 编辑 收藏 举报
listA = [1,2,3,4] listB = [8,7,6,5] listC = list(zip(listA,listB)) print(listC) listD = [x+y for x ,y in listC] print(listD)
posted on 2020-04-25 17:00 __director 阅读(219) 评论(0) 编辑 收藏 举报