One: Python introduction
1.1 Python founder Guido Van Rossum (Uncle Tortoise) was developed in 1989. Python is beautiful, clear and simple.
1.2 Python is an interpreted language, which belongs to the weakly typed language.
1.3 Advantages:
1. Elegant, clear and simple
2. High development rate
3. Portability, extensibility, embedded type
Disadvantages:
1. Slow speed,
2. Code cannot be encrypted
3. Threads cannot take advantage of multi-CPU issues
1.4 Python Interpreter
Cpython,ipython,pyy,jpython,ironpython
1.5 Python history
1991, the first Python compiler was born.
2008 python2.0 Update the same year python3.0 update (reason: 1.python2.0 too complex, not in line with the development concept
2.python2.0 cannot be used in Chinese, Solution #-*-encoding:utf-8-*-)
Variable: The result of the operation is staged into memory for subsequent use.
1. Consists of numbers, letters, underscores
2. Cannot be the beginning of a number, not a pure number
3. Cannot be a keyword in python
4. To distinguish case
5. Not too often
6. To make sense
7. Do not use Chinese
8. Recommended hump, Glide line Name
Hump (first letter capital other than the first letter of each word capitalized)
Underline (separated by _ between each word)
Note: Single-line comments with #
Multi-line comment with "' annotated content '," "" Annotated Content ""
Basic types of Python:
1.int (integer) can be +-*/
2.str (String) can be + (splicing) * (repeat)
. BOOL (Boolean) True and False
User interaction: Input ("prompt")
User content can be entered directly
If statement
Syntax 1
If condition:
code block
Else
code block
Syntax 2
If condition:
code block
Elif
code block
Else
code block
Nesting
If condition:
Results 1
If condition 2:
Results 2
else:
Results 3
else:
code block
Understanding and Understanding Python