- Python's interpreter type:
After installing Python, the official provides a Python interpreter CPython, written in C, and running Python at the command line is the CPython interpreter that launches the most widely used one.
An interpreter based on CPython, similar to CPython, is only enhanced in interactivity;
A Python interpreter written in the Java language that can be compiled directly into Java bytecode to run;
Its goal is to make Python code execute fast, using JIT technology, dynamic compilation of Python,
Running on Microsoft's. NET Platform
2.Pythong variables:
Variables in Python do not need to be declared. Each variable must be assigned before it is used, and the variable will not be created until the variable is assigned.
In Python, all uppercase variable names represent constants
3.python Data type:
- Boolean value: (Ture|false)
- Digital:
Integral type (int):
On a 32-bit machine, the number of integers is 32 bits, namely: -2**31~~2**31-1, that is: -2147483648--2147483647
On a 64-bit machine, the number of integers is 64 bits, namely: -2**63~~2**63-1, that is: -2147483648--2147483647
Long Integer type:
Python does not refer to the positioning width, theoretically can be infinitely large, but limited by memory; but there is no long in the python3, all of them are positive.
is a set of a specific subset of rational numbers, In Python, the precision is limited to the precision of the default , all languages are the same, with the storage structure of floating-point number is related
Python toolbox, there is a decimal module, GetContext (), where PREC defines the precision, the default is 28, change can be adjusted.
1>>> fromDecimalImportGetContext2>>> fromDecimalImportDecimal3>>>GetContext ()4Context (prec=28, Rounding=round_half_even, emin=-999999999, emax=999999999, Capitals=1, flags=[], traps=[Divisionbyzero, Overflow, invalidoperation])5>>> B = Decimal (1)/decimal (3)6>>>b7Decimal ('0.3333333333333333333333333333') ///28 of precision values8>>> GetContext (). Prec = 509>>> B = Decimal (1)/decimal (3)Ten>>>b OneDecimal ('0.33333333333333333333333333333333333333333333333333')////50 a precision value.
Decimal Module--enlarging floating point precision
In Python, the quoted characters are considered strings, multi-line with multi-quotes ("" "), note that the concatenation of the string can only be a string, cannot cross the data type;
Python basic definition