Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python copy

org_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
new_list = org_list.copy()

# For lists in lists you need deepcopy()

import copy

org_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
new_list = copy.deepcopy(org_list)
 
 
PREVIOUS NEXT
Tagged: #python #copy
ADD COMMENT
Topic
Name
3+2 =