PythonDictionarycopy

Returns a shallow copy of the list.

Syntax

dict.copy()

Example

Enter values below to update the example in real time.

original
clone
copy
append
print
original = [1, 2, 3]
clone = original.copy()
clone.append(4)
print(original)  # [1, 2, 3]
print(clone)     # [1, 2, 3, 4]