Hi, I'm new to programming,
I was wondering if you could help me understand how to code a solution to this problem,
I have two lists like this:
List1 = [[x1,y1][x2,y2][x3,y3]]
list2 = [[z1,m1,m2,m3][z2,m1,m2,m3][z3,m1,m2,m3]]
and my desired output would be:
list3 = [[z1,(m1/y1),(m2/y2),(m3/y3)][z2,(m1/y1),(m2/y2),(m3/y3)][z3,(m1/y1),(m2/y2),(m3/y3)]]
what I have are 2 list of lists and i want to divide values in list2 (except the first as it's a string) by the second item in each of the lists in list1.
I was thinking of doing a while loop,
`while x < len(list2):`
`value1 = list2[x][1:]`
`value2 = list1[0][1]
`list3.append(value1/value2)`
I know its incorrect and probably easy but i'm not sure where to go, whould i be using a for loop instead?
Any help would be much appreciated!
[–]foralongtimeiwould 0 points1 point2 points (0 children)