I have a list and I am comparing to check if certain set of values exist in that list and return back true or false.
Given below is what I have tried:
l1 = ['apples,oranges,bananas,pears'] <<- list 1
l2 = ['apples,'tomatoes'] <<- list 2
b2 = set(l1).intersection(l2) <<- comparing the 2 lists
On performing the above I get an error:
TypeError: 'NoneType' object is not iterable
I believe the above error means there is no data but I know the second list (l2) does have a value. Even if one value in the list matches I would like to get a True flag. Could anyone assist. Thanks
l2is missing a single quote after the wordapples. Not sure if that was just a typo here or actually in your code...