擅长:python、mysql、java
<pre><code>strings = ['I have a bird', 'I have a bag and a bird', 'I have a bag']
words = ['bird','bag']
for string in strings:
stringlist = string.split()
word1 , word2 = words
if word1 in stringlist and word2 in stringlist:
print(True)
else:
print(False)
</code></pre>
<p><strong>结果</strong></p>
<p>假
是的
假</p>