擅长:python、mysql、java
<p>python所说的“最好的方法可能有很多种”。这是其中之一:</p>
<pre><code>for i in myListOfLists:
if i[2] <= 30:
i[1] = False
</code></pre>
<p>因为“最好”可能意味着:快速,内存效率,可读性等等,你可以检查哪种方法适合你的需要。在</p>
<p>例如,要检查速度,可以使用<a href="https://docs.python.org/3.4/library/timeit.html?highlight=timeit#module-timeit" rel="nofollow">timeit</a>并比较各种解决方案。在</p>
<hr/>
<p>“最好”不是指“<a href="http://legacy.python.org/dev/peps/pep-0020/" rel="nofollow">unnecessarily complex</a>”。在</p>