I have an if statement:
if lst not in listOfLists:
And this if statement is not catching if the list for example:
lst = [[1, -1, -1, 1, 1], [1, 2, 2, 0, 1], [1, 4, 3, 0, 1], [1, 1, 1, 1, 1]]
is in a list of lists for example:
listOfLists = [[[1, -1, -1, 1, 1], [1, 0, 3, 4, 1], [1, 0, 2, 2, 1], [1, 1, 1, 1, 1]], [[1, -1, -1, 1, 1], [1, 3, 0, 4, 1], [1, 0, 2, 2, 1], [1, 1, 1, 1, 1]], [[1, -1, -1, 1, 1], [1, 0, 3, 4, 1], [1, 2, 2, 0, 1], [1, 1, 1, 1, 1]], [[1, -1, -1, 1, 1], [1, 0, 0, 4, 1], [1, 3, 2, 2, 1], [1, 1, 1, 1, 1]], [[1, -1, -1, 1, 1], [1, 3, 4, 0, 1], [1, 0, 2, 2, 1], [1, 1, 1, 1, 1]], [[1, -1, -1, 1, 1], [1, 3, 0, 4, 1], [1, 2, 2, 0, 1], [1, 1, 1, 1, 1]], [[1, -1, -1, 1, 1], [1, 3, 0, 4, 1], [1, 2, 2, 0, 1], [1, 1, 1, 1, 1]], [[1, -1, -1, 1, 1], [1, 0, 3, 0, 1], [1, 2, 2, 4, 1], [1, 1, 1, 1, 1]], [[1, -1, -1, 1, 1], [1, 0, 4, 0, 1], [1, 3, 2, 2, 1], [1, 1, 1, 1, 1]], and so on
I've tried changing the listOfLists
to a set, and converting the lst
to a tuple in the if statement. I've tried collections, all, and any.
To clarify, lst is definitely in listOfLists, but it's not finding it