Compare list of lists

Ok I see now!

output = [] #initiate output list
for ind,i0 in enumerate(IN[0]): #iterate through the first input
	output.append([]) #create an empty list to keep list structure
	for ii0 in i0: #iterate through each element in the sublist in the first input
		if ii0 in IN[1][ind]: #if element is in input 2 at the current sublist's index:
			output[ind].append(True) # add true to the current sublist in output
		else: #if element is not in sublist
			output[ind].append(False) #add false to the current sublist in output
OUT = output #return the 'output' list

5 Likes