a=[[]]*10
>>> a
[[], [], [], [], [], [], [], [], [], []]
>>> a[2].append(10)
>>> a[2]
[10]
>>> a
[[10], [10], [10], [10], [10], [10], [10], [10], [10], [10]]
>>> a=[[] for _ in xrange(10)]
>>> a[0].append(10)
>>> a
[[10], [], [], [], [], [], [], [], [], []]
时间: 2024-10-28 23:41:47