擅长:python、mysql、java
<p>只需在此处使用<a href="https://docs.python.org/3/library/functions.html#all" rel="nofollow">^{<cd1>}</a>:</p>
<pre><code>if all(a[i]==b[i] for i in range(1, 5)):
</code></pre>
<p>从文件中:</p>
<blockquote>
<p>Return <code>True</code> if all elements of the iterable are true (or if the iterable is empty).</p>
</blockquote>
<p>并且<code>(a[i]==b[i] for i in range(1, 5))</code>返回<a href="https://wiki.python.org/moin/Generators" rel="nofollow"><strong>generator</strong></a>(它是一个iterable),然后<code>all()</code>返回{<cd4>},如果生成器中的所有元素都是{<cd4>},那么{<cd6>}。就像你的代码一样。在</p>