I have this list:
dc = ["hello", "world"]
And this other:
lines = ["This is", "an example of hello", "line in the world of strings", "Testing"]
I wish to find those elements on dc which are part of any element of lines…
I may loop lines as:
for line in lines:
# what to do here?
But I don’t know how to find exactly that the “hello” element in dc is found in the “an example of hello” elemento of lines or that “world” in dc is found in the “line in the world of strings” in lines…
Maybe I shouldn’t loop through lines?
1 Answer