THE WORLD'S LARGEST WEB DEVELOPER SITE

Python Dictionary copy() Method

❮ Dictionary Methods


Example

Copy the car dictionary:

car = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}

x = car.copy()

print(x)
Run example »

Definition and Usage

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


Syntax

dictionary.copy()

Parameter Values

No parameters


❮ Dictionary Methods