copy python dict code example Example 1: copy a dictionary python new_dict = old_dict.copy() Example 2: copy a dict in python dict2 = dict1.copy()