擅长:python、mysql、java
<p>当前,您的代码正在将所有<code>Id</code>和<code>name</code>值打包到一个单一的平面列表中。当您以后需要迭代它时,这种方法就行不通了,因为每次迭代需要两个值,而您只得到一个值。在</p>
<p>虽然有一些方法可以迭代列表中的对(例如<code>zip(*[iter(x)]*2)</code>),但我建议您直接构建一个元组列表。在</p>
<p>尝试更改:</p>
<pre><code> codes.append(planet['@Id'])
codes.append(planet['@name'])
</code></pre>
<p>收件人:</p>
^{pr2}$