I have a list U of lists such that U=[a[1], a[2], a[3]]
and where a = [[0,1,2], [0,0,0],[1,1,1]]
.
I am trying to change U in a way that it will only contain lists without 2. I know that if I want U = [a[2], a[3]]
I have to do it like this:
for j in range (0,2):
U= [f for f in U if f[j]!=2]
But now I want it to return only the index of the lists, I mean at the end U should be [2,3]
.
Is it possible to do it ?
Thanks for the help !