I would sum the values of each tuple enclosed in two lists. The output i would like to get is: 125, 200.0, 100.0
.
The problem is that they don't sum, but they add like this [(87.5, 37.5), (125.0, 75.0), (50.0, 50.0)]
. I need first
and second
to stay the same as mine, without changing any parentheses. I've searched for many similar answers on stackoverflow, but haven't found any answers for my case.
How can i edit calc
and fix it? Thank you!
Code:
first = [(87.5,), (125.0,), (50.0,)]
second = [(37.5,), (75.0,), (50.0,)]
calc = [x + y for x, y in zip(first, second)]
print(calc)