Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # eval_dict.py
- original_dict = {'a': 1, 'b': [2, 3], 'c': {'x': 4, 'y': 5}}
- copied_dict = eval(str(original_dict))
- # Modify a nested object in the original dictionary
- original_dict['b'].append('***b***')
- original_dict['c']['x'] = '***4>>>c/x***'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement