I meet a problem when trying to continuously add modified dictionaries into the same list. I simplified what I want to do below:
a = {"1":"1"}
b = [a]
for i in range (2,5):
a["1"] = i
b.append(a)
print(b)
This will give me
[{'1': 4}, {'1': 4}, {'1': 4}, {'1': 4}]
But I want b as
[{'1': 1}, {'1': 2}, {'1': 3}, {'1': 4}]
How should I do this?