String/ List contains nested list input

Hello everyone,

I have quite the problem here:
I want to check if the string/ list contains any of the items in the second list. but both these lists are nested and need to be filtered at their corresponding strings. See Below:
image

I hope i have informed everyone enough with this screenshot.

Thanks in advance!
Daan

Something like that?

Yes this would work if the same numbers are in the same index, but i would like to check for each number in list 1 if it is also in list 2. This i would like to do for each nested list with only the other nested list.

If, in your example, the second list is 70,91,12,55 it would only output false.

You are right… I can produce that code:

liste1, liste2=IN
z=[]


for element in liste2:
	i=liste2.index(element)
	for el in liste2[i]:
		if el in liste1[i]:
			z.append(True)
		else:
			z.append(False)
OUT=z
1 Like

Hey there,

Try using list two in de string contains. List two in de input str. And search for.

Good luck

Hi Deniz,
Thank you for code, however when i used it, outcome was not what i expected.

Hello GĂĽray,

he had nested lists in his list. What do you actually want to do? We can adapt the code.

What i try to do is, check each element in list 1 and see if it matches any of the items in list 2. And get a result as true/false

Like that maybe?

liste1, liste2=IN
z=[]


for element in liste2:
	
	if element in liste1:
		z.append(True)
	else:
		z.append(False)
OUT=z

You can also use “==” node and List.Map to do same thing. I usually use Python codes to do my stuff.

2 Likes

:slight_smile: just like that yes! thank you very much

1 Like

how do you do it for crossed lacing? 10 inputs vs 8 inputs 10x8 results