For a mutable type such as a list, it does not change the memory address for its operation.
If the element stored in the list is an immutable type such as an integer, the address will change if the element is modified, such as:
>>> a = [1,2,3]>>> b =1 Plus to B list > >> b.append (a[0])>>> a[123] >>> b[1]
This time change the value of the first element of the A list:
>>> a[00>>> a[023]>>> b[1]
As you can see, B is unaffected because the element type is an immutable type (integer)
But if the element type is a mutable type, such as a list:
>>> a[0] = [0,0,0]>>> b.append (a[0]) #把a [ 0 ] Inside this list element join B list inside >>> a[[00023 ]>>> b[1, [000]]
Now if you change the first list element of the A list, such as adding a value with append:
>>> a[0 ].append ( " ha " ) > >> b[ 1 , [ 0 , 0 , 0 , " ha '
Summary: For nested mutable types, if another variable is added by reference, it is also the same memory address, and modifying one still affects the other.
Python__ a reference to a list take the Append action as an example