Hi all…how to get index of two List in the picture?
Thank you…
Are they always at position 2 and 3?

What exactly are you wanting to do? You’re already getting the index of each item. Can you show us what your expected outcome would be?
Hi @Eng.Minh,
Welcome to the Dynamo community.
Try copy-pasting the code as shown below into a Python node in your graph.
IndexOf (No Repeat).dyn (5.4 KB)
OUT = []
for i,x in enumerate(IN[1]):
allIndices = [j for j,y in enumerate(IN[0]) if y == x]
if allIndices:
try:
k = IN[1][:i].count(x)
OUT.append(allIndices[k])
except:
OUT.append(allIndices[-1])
else:
OUT.append(-1)
@Eng.Minh Just swap the inputs on Python node.
Thannk you very much



