I would like to determine whether a list of strings can be found within another list of strings in python.
For example:
list1 = ['iguana','cat','spider','monkey','dog']
list2 = ['cat','dog']
result = False
for i in list1:
for j in list2:
if list1[i] == list2[j]
result = True
print(result)
and the result is true, but this seems to cause problems on larger lists
Is there any way to search through the first list more efficiently with cleaner code?
.issubset/.issuperset(depends on which one you converted)