Home >>Python Dictionary Methods >Python Dictionary copy() Method
Python Dictionary copy() Method in python dictionary returns a shallow copy of the specified dictionary.
Syntax:dictionary.copy()Here is an Example of Python Dictionary copy() Method:
color =
{
"color1": "orange",
"color2": "green",
"color3": "blue"
}
z = color.copy()
print(z)
org = {1:'php', 2:'tpoint'}
dup = org.copy()
dup.clear()
print('dup: ', dup)
print('org: ', org)