1.
运行如下代码
l = [{}, {}, {}]
for k in l:k[1] = 1
print(l)
输出为
[{1: 1}, {1: 1}, {1: 1}]
2.
运行如下代码
l = [{}, {}, {}]
for k in l:k = {1:1}
print(l)
输出为
[{}, {}, {}]
3.
运行如下代码
l = [1,2,3]
for k in l:k = k * 2
print(l)
输出为
[1, 2, 3]