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?
Forum PHP for programmers) There may be no answer
|
Welcome Guest, Not a member yet? Register Sign In |