In Python, when we make a variable equal to another variable, it does not pass the value to it, but instead directly changes the address to the point. We want to see the address of a variable in memory, which can be viewed by ID (variable). Let's take a look at this interesting process through a small example.
>>> x = 12>>> y= 13>>> ID (x) 1865402384>>> ID (y) 1865402416>>> x = y>>& Gt ID (x) 1865402416>>> ID (y) 1865402416
The first assignment of the x variable to the 12,y variable is 13, and we use the ID (variable) to see where x and Y are in memory, respectively. The above shows 1865402384 and 1865402416 respectively. Then we make x = y, and then we look at where they are in memory and find that both X and Y point to 1865402416. Thus, in Python, the way we assign values differs from the C language, and C directly changes the value in X's memory, and Python directly changes the direction of X, which reminds me of pointers.
Let's try it and continue to enter the following code here
>>> y = 12>>> id (y) 1865402384
Days! What happened?? Y's address in memory becomes 1865402384, and, exactly, Y points to 1865402384 of this area of memory. In this way, the pointers to the C language are really similar.