For example, I have two list of sets:
list1 = [{'a','b'}, {'c','d'}, {'a','b','c'}, {'c','f'}]
list2 = [{'c','d','e'}, {'e','f'}, {'a','b','d'}, {'c','f'}]
I need to output a list of indices where list1[i] and list2[i] don't share common elements. (no intersection)
In this case, {'a','b'} has no common elements in {'c','d','e'}.
{'c','d'}has no common elements in{'e','f'}.{'a','b','c'}has common elements'a'and'b'in{'a','b','d'}.{'c','f'}has common elements'c'and'f'in{'c','f'}.
So list1[0] and list1[1] do not have the same element(s) in list2[0] and list2[1]
It will return a list of indices: list = [0,1]
My approach is:
for l1,l2 in zip(list1,list2):
for i in l1:
if i in l2:
print(i)
This is clearly not correct. Any help is appreciated.