The range of int python2: On a 32-bit machine, the number of integers is 32 bits, and the value range is -2**31~2**31-1;
On a 64-bit system, the number of integers is 64 bits and the value range is -2**63~2**63-1;python3:
Theoretically the length is infinite (as long as the memory is large enough)
Second, Python memory mechanism
In general, when a variable is assigned, the relationship between the memory and the variable is as follows:
Special cases:
The optimization mechanism within Python (either 2.7 or 3.5):
-5 to 257, if the first assignment is used, then they are still in the same block of memory (can be viewed with ID)
Third, the source code int small Knowledge Point:
In the Python2:
Test = 9/2 Output--4from __future__ import divisiontest = 9/2 output--4.5
And in the Python3:
Test = 9/2 Output--4.5
Python basic data type--int