I have a problem when working on jupyter notebook using python 3.6.3. when I write following code in one cell and execute:
x=dict()
y=dict()
for j in range(3):
x[j]=str(j)
y=x
for i in range(2):
y[i]=5
This will give me the result that both x and y being the same as {0:5,1:5,2:'2'}, which is weird to me since I expect x={0: '0', 1: '1', 2: '2'} and y = {0: 5, 1: 5, 2: '2'}. I don't understand why the above code will change x as well while I assign new values to y Thanks