标签:app xrange pen range bsp append nbsp for 列表
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], [], [], [], [], [], [], [], [], []]
标签:app xrange pen range bsp append nbsp for 列表
原文地址:http://www.cnblogs.com/jyxbk/p/7295289.html