python basis
python is a high-level programming language, and is divided into three kinds of programming languages
Programming language
Programming language is a tool for people to communicate with the computer.
Programming is people will need to complete the programming language instruction through clenched write commands from the computer.
Programming is the meaning of human productivity liberated from the simple duplication of effort in.
History of programming languages:
1. Machine Language: based on the binary, it is possible to communicate directly with the computer language, it can be characterized by the hardware directly.
Pros: The computer can directly read, execute the fastest.
Disadvantages: difficult to learn, difficult to prepare, extremely low development efficiency
2. assembly language: English with a simple label to represent a binary, direct manipulation of hardware
Advantages: develop more efficient than machine language
Cons: the efficiency is slightly lower than the machine language
3. Advanced Language: standing human-friendly point of view, the design language, divided compiled, interpreted.
3.1 compiled (after a translation, you can run took the results translated many times, usually saved as a separate file) compiler
3.2 interpreted (line by line translation) interpreter development efficiency slightly higher than compiled, the efficiency is lower than that compiled
python characteristics: glue language
Changeling Man
python interpreter is divided into many pycharm vscode anoconda
Python36.exe may be increased to select the path when manually configured by python.exe execution environment after the environment variables by copying the configuration.
python operation mode
Interactive input content immediately return a result in memory
Command line permanently store data, save trouble
Role .py extension is only saved posters,
Python interpreter run from the hard disk into memory then.
Py file contents from the hard disk into memory,
Py interpreter then read the contents of the file.
variable
State variables are measurable characteristics record of things
And the state can vary
Help us record-keeping characteristics and state of things, and to call the mark
Variable three elements
id (): Returns the memory address
type (): returns the data type
The value of the variable points to the data memory among: value ()
Comments are the core code, the code to run successfully in code readability is equally important
Garbage collection:
Reference count: the number of the reference variable to zero if the automatic recovery were
Clear labeling: When the memory is quickly filled a program, automatically triggered.
Generational recovery: Depending on survival time, divided into different levels, the slower the scanning frequency of garbage collection mechanism of the higher grade.
Variable constants in all uppercase letters; remember not just change, because the python is useless constant, it only agreed all-caps is a constant, and the constant changes is critical, do not tamper.