Python Loop Double Printing
You should zip
instead of a nested loop to iterate both lists concurrently:
forwardOutright = [x+y for x, y in zip(spot, forwardSwap)]
As per the given code in your question, both of your loops are using a variable named as i
.
for i in range(len(spot)):
for i in range(len(forwardSwap)):
This should work
list(map(lambda i: sum(i), zip(spot, forwardSwap)))