擅长:python、mysql、java
<p>Python参考资料回答了您的问题。<a href="https://docs.python.org/2/reference/expressions.html#boolean-operations" rel="nofollow noreferrer">https://docs.python.org/2/reference/expressions.html#boolean-operations</a></p>
<blockquote>
<p>The expression <code>x and y</code> first evaluates <code>x</code>; if <code>x</code> is false, its value is
returned; otherwise, <code>y</code> is evaluated and the resulting value is
returned.</p>
<p>The expression <code>x or y</code> first evaluates <code>x</code>; if <code>x</code> is true, its value is
returned; otherwise, <code>y</code> is evaluated and the resulting value is
returned.</p>
</blockquote>
<p>容器类型的值(如集合和列表)如果为空则视为false,否则视为true。你知道吗</p>