I have a problem with python scpripting in dynamo. My script works in online interpreter correctly but in dynamo there is no output or error. It says empty for OUT variable. I checked list1 and list2 . I ve tried to add only list1 or list2 to the OUT variable and it happened. I have tried the all script and it gave me empty OUT variable. I couldn’t understand the problem. Thanks for helping.
list1=[1,3,5,4,2]
list2=[[5,"db"],[2,"cfk"],[3,"vnvod"],[1,"nrı"],[4,"fmro"]]
result=[]
for j in list1:
for i in range(len(list2)) :
if j==list2[i][0]:
result.append(list2[i][1])
OUT=result
print(OUT)
list1 is integer list2 is integer and strings list1=[integer] , list2=[[integer,string]]. Here I am matching the integer parts. If that is the problem ,then i should divide the list2 as two different lists and then compare integer parts. Is that right?
You are right. The problem was about the data. I was getting the data from an excel sheet for list2 and it was general type in excel. So i have changed the both list1 and list2 to string type after reading data and it worked fine for me too. Thank you for your help.