I have a list of lists and you want to check if it already contains a list with certain elements.
From this example, it should be clear:
list = [[1,2],[3,4],[4,5],[6,7]] for test in [[1,1],[1,2],[2,1]]: if test in list: print True else: print False
Is there a function that compares list items, no matter how they are sorted?
source share