1. 程式人生 > >華為AI隨筆(7)

華為AI隨筆(7)

>>> x=[1,2,3]
>>> y=[11,22,33]
>>> import copy
>>> z=x
>>> z
[1, 2, 3]
>>> z[1]=102
>>> z
[1, 102, 3]
>>> x
[1, 102, 3]
>>> z[-1]=103
>>> z
[1, 102, 103]
>>> x
[1, 102, 103]
>>> z=copy.copy(x)
>>> x
[1, 102, 103]
>>> z[-1]=96
>>> z
[1, 102, 96]
>>> x
[1, 102, 103]
>>>