Python Dictionary copy() Method

Instance

Copy car dictionary:

car = {
  "brand": "Porsche",
  "model": "911",
  "year": 1963
}
x = car.copy()
print(x)

Running Instance

Definition and Usage

The copy() method returns a copy of the specified dictionary.

Syntax

dictionary.copy()

Parameter Value

No parameters.