# Compare list of lists

**URL:** <https://forum.dynamobim.com/t/compare-list-of-lists/34111>\
**Category:** Lists-Logic\
**Created:** [March 28, 2019, 3:26pm UTC](https://forum.dynamobim.com/t/compare-list-of-lists/34111 "2019-03-28T15:26:08Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![martin.scholl](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/martin.scholl/32/54233_2.png) [@martin.scholl](https://forum.dynamobim.com/u/martin.scholl)\
**Post date:** [March 28, 2019, 7:07pm UTC](https://forum.dynamobim.com/t/compare-list-of-lists/34111/15 "2019-03-28T19:07:27Z")

</div>

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

```

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/d/2d6af78b0b6bec6ded38a506328b1f7bb4c3608a.png)

---

_[View the full topic](https://forum.dynamobim.com/t/compare-list-of-lists/34111)._
