I want to test if reference_list
contains all of the items in required_strings
.
required_strings = ['apple','banana','carrot']
reference_list = [['apple','tree'],
['banana','grass'],
['carrot','grass']]
I want to get true or false as the test result. The expected answer is 'true'.
This is what I had attempted:
test = [i for i in reference_list if any(s in i for s in required_strings)]
print test