Hi everyone,
I’m writing code that allows me to subtract the last item, which is not equal to the other items, from each sublist of my original list. Additionally, I want to update the original list within the main loop since it is related to a condition. I am aware that I can update it later using the code original_lst = original_lst[:-1]
…so I can create the substract list but I can’t update the original list and I’m getting this error
here my code:
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
lst1= [37.39, 37.39, 27.28]
original_lst = []
for i in range(0,10):
temp = []
for j in lst1:
temp.append(j)
original_lst.append(temp)
substract_list = []
for i in range(0, len(original_lst)):
for j in original_lst[i]:
if j != 37.39:
substract_list.append(j)
original_lst.remove(j)
OUT = substract_list, original_lst
Any help would be apreciated
Thanks.