Using the code below, I can get the correct answer, however it repeats itself twice .
For example, I would like to get the result [1.2038, 1.206] , but the code below prints [1.2038, 1.206, 1.2038, 1.206] . Does anyone know what is wrong with my code? Any help would be greatly appreciated. Thank you
spot = [1.2020, 1.2040] forwardSwap = [0.0018, 0.0020] forwardOutright = [] for i in range(len(spot)): for i in range(len(forwardSwap)): forwardOutright.append(spot[i] + forwardSwap[i]) print forwardOutright
source share