擅长:python、mysql、java
<p>可以使用与列表<code>[]</code>相同的索引对<code>tuple</code>进行索引。因此,如果需要第二个元素<code>list</code>,可以从函数调用的返回中索引元素<code>[1]</code>。你知道吗</p>
<pre><code>def get_stuff():
return 'a string', [1,2,3,5]
all_stuff = [6,7]
all_stuff.extend(get_stuff()[1])
</code></pre>
<p>输出</p>
<pre><code>[6, 7, 1, 2, 3, 5]
</code></pre>