擅长:python、mysql、java
<p>根据以上评论,您可以通过以下方法解决问题:</p>
<pre><code>max(x for x in list_int if x % 2 == 0)
</code></pre>
<p>您的代码必须按以下方式修改,这样才能获得传递列表中最大的偶数:</p>
<p>1-您需要修复代码中的缩进(我猜这是由于复制和粘贴)</p>
<p>2-您可以找到最大的:</p>
<pre><code>large = None
for x in list_int:
if x % 2 == 0:
if large is None:
large = x
if x > large:
large = x
</code></pre>