Again code, record Python knowledge points, about Python variables, conditional judgment, loop statements
I. Classification of programming languages
1. Compiled language
After writing the code, compile the code into a binary file and run the compiled binaries when running. Like c/c++,c# and so on.
The feature is: run faster than fast, compile at once, run everywhere.
The disadvantage is that the compilation process is slow.
2. Explanatory language
Run a line of code to compile a line and when to run the code, such as: Php,python,ruby,java,go JavaScript, and so on. The Java language is also an explanatory language, and the. java file is compiled into a. class file, which is then executed by the JVM.
Disadvantage: Slow Running
3. Scripting language
A single language, called a scripting language. such as: Shell, bat, javascript,html,vb and so on.
Second, Python variables
1. Variable declaration
Python variables do not need to be declared in advance and are used directly, such as:
name = ' MyName '
Print (name)
You can assign a value that is declared.
2. Use of Python ', ', ', ' ', ' "'"
III. basic data types for Python
Iv. Conditions of Judgment
1, the conditional judgment statement is relatively simple, the following several:
If condition true:
EXECUTE Statement 1
Else
EXECUTE Statement 2
Example:
2, If-elif-else type
Extension: operator
> (greater than), < (less than), >= (greater than or equal), <= (less than equals),! = (not equal to), = = (equals)
If-elif-else Example:
V. Circulation
The loop repeats to do a thing. The Python loop has a for and while.
1. While loop
2. While-else Cycle
3. For loop
Six, string formatting
The code above is written using python3.6.4, Pycharm IDE, and executes successfully.
Python Learning Note-day1