Value type:
Contains: strings, tuples, numeric values, which are not allowed to be modified by themselves
Reference type:
Include: list, dictionary, itself allows modification
A = 2
b = A
A = 3
Modifies the value of a value type to point to a new memory address and does not change the value of the variable B
Lista = [up]
Listb = Lista
Lista[0] = 3
Modify the value of the reference type because the address of the LISTB is consistent with the Lista, so it is also modified
Typically only to replicate values, you can use the Shard operation
Listb = lista[:]
Value passing is only passing values
The reference is passed, the memory address is passed, and the memory address corresponding to the stored value is changed after the modification.
Using arrays to illustrate the clearest, for example, we define an array a[]={1,2};
So a[0]=1,a[1]=2.
If we pass the value of an element in array A as an argument, it is actually just a value pass, and the array itself has no effect
If we pass the pointer of array A as a parameter, then if the function is processed, it can directly modify the value in array a.