My goal is to return True/False if I am able to detect two items within a nested list.
E.g.
list1 = [['1', 'sjndnjd3', 'MSG1'], ['2', 'jdakb2', 'MSG1'], ['1', 'kbadkjh', 'MSG2']]
I want to iterate over this list to confirm if I can find '1' & 'MSG1' within a nested list. Important to note I only want this to return true if both items are found and if they're found within the same nested list.
I've tried various combinations of the below however I cannot get it quite right.
all(x in e for e in list1 for x in ['1', 'MSG1'])
Any assistance is greatly appreciated.