I have a dict
default_x = {'a' : 1, 'b' : 1}
Later I am updating this dict based on my problem.
But whenever when I am calling this default_x.
I want it to it's default value not it's updated value. Any guidance on this. example:
def func1(key, val):
x = default_x
x[key] = val
temp = func1('a',2)
output is {'a' : 2, 'b' : 1}
Now if i call
temp = func1('b',2)
output is {'a' : 2, 'b' : 2}
I want my output for second execution as
output is {'a' : 1, 'b' : 2}