Apr-21-2018, 01:23 AM
Hi i really need help with creating a list of lists using a for loop under the following conditions:
a = [-1, 2, -2, 3, 41, 38, 22, 10, -1, 3] b = [40, 30, 20, 10] list0 = a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3] = 10 list1 = a[1]*b[0] + a[2]*b[1] + a[3]*b[2] + a[4]*b[3] = 490 list2 = a[2]*b[0] + a[3]*b[1] + a[4]*b[2] + a[5]*b[3] = 1210 and so on.... the answer is the final list of values below answer = [10, 490, 1210, 2330, 3320, 2370, 1190]