擅长:python、mysql、java
<p>关于<code>and</code>操作符的工作原理已经有了很好的解释,因此我只想添加一个快速解决方案来测试多个数字是否小于另一个数字:</p>
<pre><code>if max(value1, value2, value3) < value4:
print("True")
</code></pre>
<p>这是可行的,因为内置的<code>max</code>函数返回给定值的最大数目。它还可以使用列表或元组作为输入:</p>
<pre><code>number = [value1, value2, value3]
if max(numbers) < value4:
print("True")
</code></pre>