Python Dictionary copy() Method

❮ Dictionary Methods


Example

Copy the car dictionary:

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

x = car.copy()

print(x)
Try it Yourself »

Definition and Usage

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


Syntax

dictionary.copy()

Parameter Values

No parameters


❮ Dictionary Methods

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.