Problem with Dictionary Copies |
Hello there,
I'm new to this and trying to make a clone of a dictionary so that I may make changes without harming the original, as I learnt from scaler's post. However, even after making the copy, the modifications I make appear to have an effect on both the copy and the original dictionary. This is my code: Code: original_dict = {'x': 1, 'y': 2, 'z': 3} Surprisingly, both dictionaries exhibit the same 'x' value. I thought I'd made a separate duplicate, but it appears that modifications to one are affecting the other. How can I actually make a duplicate of the dictionary? |
Messages In This Thread |
Problem with Dictionary Copies - by leusiam - 08-23-2023, 05:37 AM
RE: Problem with Dictionary Copies - by ozornick - 08-23-2023, 05:46 AM
|