I am using dictionary as argument to the function.
When i Change the values of the argument passed, it getting changed parent dictionary.i have used dict.copy() but still not effective.
How to avoid mutable in dictionary values. Need your inputs
>>> myDict = {'one': ['1', '2', '3']}
>>> def dictionary(dict1):
dict2 = dict1.copy()
dict2['one'][0] = 'one'
print dict2
>>> dictionary(myDict)
{'one': ['one', '2', '3']}
>>> myDict
{'one': ['one', '2', '3']}
My intention was my parent dictionary should be changed. Thanks, Vignesh