Learn Before
Concept
copy()
The copy() method returns a copy of the dictionary. Usage:
student = { "name": "John Smith", "year": 3, "major": "Computer Science" } clone = student.copy() print(clone)
The student dictionary is copied to clone. The final print statement outputs {'name': 'John Smith', 'year': 3, 'major': 'Computer Science'}.
0
1
Updated 2021-05-17
Tags
Python Programming Language
Data Science