Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Shallow copy in python and adding another array to list

import copy
list1 = [[9, 8, 7], [6, 5, 4], [3, 2, 1]]
list2 = copy.copy(list1)
list1.append([10, 11, 12])
print("Old list:", list1)
print("New list:", list2)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Shallow #copy #python #adding #array #list
ADD COMMENT
Topic
Name
2+4 =