Python 字典 copy() 方法
示例
复制 car
字典
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
x = car.copy()
print(x)
自己尝试 »
定义和用法
The copy()
方法返回指定字典的副本。
语法
dictionary.copy()
参数值
无参数
复制 car
字典
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
x = car.copy()
print(x)
自己尝试 »
The copy()
方法返回指定字典的副本。
dictionary.copy()
无参数
If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]
If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]