Variables, memory management and assignment of fancy

First, what is variable

Variables can be understood from the literal meaning: is the amount of change. I know the computer by recording our state. This is the concept of quantity.

Capacity: recording status in the real world, so that the computer can like people to identify things in the world.

Change: the state of the real world will change happen.

Second, the definition of variables (compositional variables)

Variable names assign symbolic variable values

python Example: age = 18

Third, memory management

Among the variables stored in memory, if the variable reference count value is not binding, it will be cleaned up to free up memory.

[-5,256] is a small integer pool will not be cleaned up.

Fourth, fancy assignment

Chain assignment

Example: A = B = C = D = 10

Cross assignment

例:x,y = y,z

 

Guess you like

Origin www.cnblogs.com/gongsla/p/11264826.html