将元素追加到列表中的特定列表 - Python

时间:2017-11-06 19:20:09

标签: python python-2.7 arraylist

child= [[]] * 10
child[0].append(3)

我预计输出为

child
[[3], [], [], [], [], [], [], [], [], []]

输出结果为

child
[[3], [3], [3], [3], [3], [3], [3], [3], [3], [3]]

0 个答案:

没有答案