Can someone please explain this to me? This doesn\'t make any sense to me.
I copy a dictionary into another and edit the second and both are changed. Why is this hap
Copying by using a for loop:
orig = {"X2": 674.5, "X3": 245.0} copy = {} for key in orig: copy[key] = orig[key] print(orig) # {'X2': 674.5, 'X3': 245.0} print(copy) # {'X2': 674.5, 'X3': 245.0} copy["X2"] = 808 print(orig) # {'X2': 674.5, 'X3': 245.0} print(copy) # {'X2': 808, 'X3': 245.0}