擅长:python、mysql、java
<p>您只需使用<code>in</code>运算符:</p>
<pre><code>l1 = ["fish", "boat", "oar"]
l2 = ["rod", "gunwale", "fish", "net"]
l3 = ["net", "hook", "weight"]
for w in l1:
if w in l2:
print 'found %s in l2!' % w
if w in l3:
print 'found %s in l3!' % w
</code></pre>
<p>如果要检查它是否在其他两个列表中的任何一个,只需将它们组合起来,然后在其中执行相同的检查:</p>
^{pr2}$
<p><a href="https://repl.it/G4KX" rel="nofollow noreferrer">Demo</a></p>