a = {"a": 1}
b = []
b.append(a)
a = {"a": 2}
b.append(a)
print(b)
[{'a': 1}, {'a': 2}]
result = []
a = {}
a["a"] = 1
result.append(a)
a["a"] = 2
result.append(a)
print(result)
[{'a': 2}, {'a': 2}]
a = {"a": 1}
b = []
b.append(a)
a = {"a": 2}
b.append(a)
print(b)
[{'a': 1}, {'a': 2}]
result = []
a = {}
a["a"] = 1
result.append(a)
a["a"] = 2
result.append(a)
print(result)
[{'a': 2}, {'a': 2}]
本文标题:python中得引用坑
本文链接:https://www.haomeiwen.com/subject/ishqkqtx.html
网友评论