python多個列表對應位置元素相加

a = [1,2,3] b = [4,5,6] c = [(a[i]+b[i])/2 for i in range(0,len(a))] print(c) 結果爲:[2.5, 3.5, 4.5]
相關文章
相關標籤/搜索