The .copy() method of a Python dictionary returns a copy of the dictionary. It takes no arguments.



Codebyte Example

The following example creates a dictionary, creates a copy of the dictionary, then adds new elements to the copy.

Interested in helping build Docs? Read the Contribution Guide or share your feedback form.

Learn Python on Codecademy