擅长:python、mysql、java
<p>错误可能在代码的其他地方,因为它应该工作正常:</p>
<pre><code>>>> 3 not in [2, 3, 4]
False
>>> 3 not in [4, 5, 6]
True
</code></pre>
<p>或使用元组:</p>
<pre><code>>>> (2, 3) not in [(2, 3), (5, 6), (9, 1)]
False
>>> (2, 3) not in [(2, 7), (7, 3), "hi"]
True
</code></pre>