1. Python is a dynamic, interpretative, mandatory definition language.
| Compiled type |
Source code for conversion (compiler), such as: C + +, VB and so on. |
| Explanatory type |
Read an explanation, for example: Java, JS, Vbscipt, Perl, Python, etc. |
Note: With the development of design technology and hardware, the boundary between the two ways of compiling and interpreting is becoming blurred.
| Dynamic language |
Data type checking is done during runtime, for example: Python, etc. |
| Static language |
The data type of all variables to be life when writing a program, for example: C #, Java, etc. |
| Strongly typed definition language |
Enforces the language of the data type definition. (Forced type conversion) |
| Weak type definition language |
A variable can give values of different data types. |
2. The advantages and disadvantages of the Python language:
Excellent: Easy to get started, high development efficiency (third-party library Rich), advanced language, portability, extensibility, embeddable
Missing: Slow running, code cannot be encrypted, threads cannot take advantage of multi-CPU issues
3. Python forces indentation.
python Installation: Download the installation package-"Configure Environment Variables-" Download IDE tools,
First Python program: HelloWorld
4. Character encoding and annotation
ASCII-GB2312-Unicode (Utf-8)
Single-line Comment: # commented content
Multi-line Comment: ' Annotated content '
The default character encoding in Python3 is utf-8.
5. Variable store information to be refereced and maniplated
When assigning a value to a name, it is stored in memory, which becomes a variable (variable).
Variable name naming rules:
- Keywords cannot be declared as variable names [' and ', ' as ', ' assert ', ' Break ', ' class ', ' Continue ', ' Def ', ' del ', ' elif ', ' Else ', ' except ', ' exec ', ' finally ' ' For ', ' from ', ' global ', ' if ', ' import ', ' in ', ' was ', ' lambda ', ' not ', ' or ', ' pass ', ' print ', ' raise ', ' return ', ' Try ', ' While ', ' with ', ' yield ']
- The first character of a variable name cannot be a number
- Variable names can only be any combination of letters, numbers, or underscores
- Variable names differ case
- Variable name try to take a professional name
Assignment of variables:
Note: The general constant variable name should be capitalized (indicating that it should not be changed)
user input:input () in Python, all input defaults to a string type and requires casting.
algorithm: A detailed description of doing something. (Commands executed sequentially: Direct completion, specific conditions, number of repetitions)
statement: An instruction that tells the computer to do something.
functions: functions in the same mathematics.
modules: extensions to Python functionality that can be imported into Python.
Python Learning note _day1_ initial python