0
is there any function to check if the content of a list are present in another list?
2 Antworten
+ 5
The procedure to get this task done, can be different, depending on the structure of the list. If you have a flat list you can search like Slick mentioned.
If you have a list of strings, or list of list (nested lists), you also need to use a nested for loop to get the result.
Jeet Swarnakar , could you please give us a sample of your input list, and also the sub-list to search for? Thanks!
0
usually the "in" operator works fine. as in:
if sublist in list:
print("Yup, it's in there.")