Index of items not found in sublist_A as compared to sublist_B using python

Index of items not found in listA as compared to listB

listA = [[a,b,a,b,c],[c,f,q,a],[a,b,c,d,a,a]]
listB = [[a,b],[c,f],[a]]

test = [i for i, enumerate(listB) for items not in (listA)]

desired_output_indices = [[4],[2,3],[1,2,3]]

Answer

It’s a bit trickier than you thought:

[[idx for idx, elt in enumerate(sublists[0]) if elt not in sublists[1]]
  for sublists in zip(listA, listB)]