擅长:python、mysql、java
<p>我可以看到你的代码有两个主要问题:</p>
<ol>
<li><p><code>i</code>迭代第一个列表元素的<em>索引</em>,因此在第二个列表中查找的是这些索引,而不是元素本身。</p></li>
<li><p>在Python中,删除正在迭代的列表元素是有问题的:<a href="https://stackoverflow.com/questions/6022764/python-removing-list-element-while-iterating-over-list">Python: Removing list element while iterating over list</a>。</p></li>
</ol>