复制 car 字典:
car = { "brand": "Porsche", "model": "911", "year": 1963}x = car.copy()print(x)
car = {
"brand": "Porsche",
"model": "911",
"year": 1963
}
x = car.copy()
print(x)
copy() 方法返回指定字典的副本。
copy()
dictionary.copy()
无参数。