I have the following code:
y = [sum(x) for x in ([0, 1, 2], [10, 11, 12], [20, 21, 22])]
print(y)
The output is: [3, 33, 63]
What I am after is summing by position in each list, so the output I am wanting is:
[30, 33, 36]
0 + 10 + 20 = 30
1 + 11 + 21 = 33
2 + 12 + 22 = 36
What am I doing wrong?