How to make RemoveListfromList?

Hello,

I try to rebuild a node . RemoveListFromList . Actually i do not understand the node:

OUT = []

for v in IN[0]:
if v not in IN[1]:
    OUT.append(v)

So what does the output say? I can`t follow the logic

(…by the way, which package do i miss? :slight_smile: )

KR

Andreas

You have to add a tab after loop and other ones too.

1 Like

Hello

the items 2 and [3,3] are not in List B (IN[1])

1 Like

1 Like

In simple language:

for v in IN[0]:
this means loop through every item in the list which you connected to IN[0].
“v” is something you choose yourself, so that can also be “listitem” or so.
So the loop picks [1,2] then 2, then [3,3] then 4 and finally 5

. . . if v not in IN[1]:
. . . while you are in that loop, you are checking if ‘v’ is not in the list on IN[1]
. . . if so (thus v is not in IN[1]): add v the OUT list.

2 Likes