例如:
复制car
字典:
car = {"brand": "Ford","model": "Mustang","year": 1964}x = car.copy()print(x)
1、定义和用法
copy()
方法返回指定字典的副本。
2、调用语法
dictionary.copy()
3、参数说明
没有参数
4、使用示例
dict1 = {'Name': 'Zara', 'Age': 7}; dict2 = dict1.copy()print"New Dictinary : %s" % str(dict2)