18.3.5 python definition of variables, 18.3.5python
The definition of python variables is quite different from that of C.
C language variables:
Int I = 6
Python variable usage:
I = 4
A c-language variable must first declare the type of the variable and assign values to it. The underlying hardware layer refers to the division of a space (variable name) in the memory space, the size is related to the data type, and then the data is placed.
This series of processes ensures security first. Although syntactically complicated, it saves more space than python, because the C language divides the required memory space based on the size required by each variable.
The syntax of variable definition in python is more like Paster. The constant on the right of the value assignment statement is stored in the memory space. The variable name defined is equivalent to sticking to the constant, the data type does not need to be declared. What is more different from the C language is that the object assigned by python is not limited to the Data Type of the value assignment content, that is to say, the same variable can be "pasted" on the string and "pasted" on the integer. However, the content assigned by each sentence is stored in different locations in the memory, and the logical statement compares the data size.
For example, and compares whether the expressions on both sides are both true and true returns true.
Is to compare whether the locations in the memory are the same