Python copy()函數詳解(list, array)

list python變量名相當於標籤名 list2 = list1, 直接賦值,實質上指向的是同一個內存值。任意一個變量(list1 or list2)發生改變,都會影響另外一個。 e.g. >>> list1=[1,2,3,4,5,6] >>> list2=list1 >>> list1[2]=88 >>> list1 [1, 2, 88, 4, 5, 6] >>> list2 [1, 2,
相關文章
相關標籤/搜索