回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>我有这样的代码:</p>
<pre><code>Loop that appends player names to a list called playerlist
print(playerlist)
lineuplist.append(playerlist)
</code></pre>
<p>print语句最后打印的列表如下所示:</p>
<pre><code>...
['Omer Asik', 'Jordan Farmar', 'Patrick Beverley', 'Kyle Korver', 'Kent Bazemore', 'Pau Gasol', 'Paul Millsap', 'Chandler Parsons', 'Kevin Durant']
['Omer Asik', 'Jordan Farmar', 'Patrick Beverley', 'Kyle Korver', 'Kent Bazemore', 'Serge Ibaka', 'Pau Gasol', 'Kevin Durant', 'Chandler Parsons']
['Omer Asik', 'Jordan Farmar', 'Patrick Beverley', 'Kyle Korver', 'Kent Bazemore', 'Serge Ibaka', 'Pau Gasol', 'Chandler Parsons', 'Kevin Durant']
['Omer Asik', 'Jordan Farmar', 'Patrick Beverley', 'Kyle Korver', 'Kent Bazemore', 'Paul Millsap', 'Pau Gasol', 'Kevin Durant', 'Chandler Parsons']
...
</code></pre>
<p>我希望我的输出是这些列表的列表,即:</p>
<pre><code>[['Omer Asik', 'Jordan Farmar', 'Patrick Beverley', 'Kyle Korver', 'Kent Bazemore', 'Pau Gasol', 'Paul Millsap', 'Chandler Parsons', 'Kevin Durant'], ['Omer Asik', 'Jordan Farmar', 'Patrick Beverley', 'Kyle Korver', 'Kent Bazemore', 'Serge Ibaka', 'Pau Gasol', 'Kevin Durant', 'Chandler Parsons'], ['Omer Asik', 'Jordan Farmar', 'Patrick Beverley', 'Kyle Korver', 'Kent Bazemore', 'Serge Ibaka', 'Pau Gasol', 'Chandler Parsons', 'Kevin Durant'], ['Omer Asik', 'Jordan Farmar', 'Patrick Beverley', 'Kyle Korver', 'Kent Bazemore', 'Paul Millsap', 'Pau Gasol', 'Kevin Durant', 'Chandler Parsons']]
</code></pre>
<p>然而,我得到的是:</p>
<pre><code>print(lineuplist)
[[], [], [], [], []]
</code></pre>
<p>我不太清楚我哪里出错了,所以任何帮助都很感激。你知道吗</p>