I want to create a dictionary where each value is a dictionary. Here's what I have:
start = 1
for i in range(3):
updated_payload = payload
updated_payload["params"]["dsoJsonData"]["ReadMap"]["Some"]["StartIndex"] = start
x[i] = updated_payload
start = start + 1
Where payload
is also a dictionary with all the needed attributes. I am just changing the StartIndex
attribute to whatever the loop is at that time. However, when I run this piece of code all my dictionaries' keys have the same exact values. StartIndex
all equal to 3. Why are they all getting the same value and how can I fix it so that it gets its respective iteration number?