Part 1 variable
First, what is a variable?
Second, why have variable?
Third, the definition of variables
Fourth, the compositional variables
Fifth, the name of the variable naming conventions
Six, two styles of variable names
Part 2 Constant
Part 3 Python variable memory management
A variable storage location
Two, Python garbage collection
Idiom summarized garbage collection: Tuiweirangxian
Reference count
Third, small integer pool
Part 4 wherein three variables
First, print
Second, determine the value of the variable is equal
Third, the variable is determined whether the same id
Part 5 Fancy assignment
First, the chain assignment
Second, cross-assignment
Part 6 comments
First, a comment
Second, the principle of adding comments
Key: # single-line comments, '' '& "" "multi-line comments
Part 7 based data type
First, what is the data type?
Second, why the data classification?
Third, different types of data
Digital Type
Integer (int) & Float (float)
-
- Role definition , How
String type ( "input" accepted are strings)
-
- Role definition , How
List Type
-
- Role definition , How
Dictionary Type
-
- Role definition , How
Boolean
-
- Role definition , How
Part 8 decompress
First, unzip
Part 9 Python and user interaction
First, why the interaction?
Second, how to interact?
Three, Python2 interaction
Part 10 in three ways formatted output
A placeholder
Two, format to format (not recommended)
Three, f-string format (recommended)
Part 11 basic operators
First, arithmetic operators
Second, comparison operators
Third, the assignment operator
Fourth, the logical operators
Note: bool main logical judgment operation, "and" = and, "or" = or
Fifth, the identity of the operator
Six, Python operator precedence
Part 12 determines if the flow control
First, grammar
- if
- if...else
- if...elif...else
Two, if nested
Part 13 of the process control loop while
First, grammar
二、while+break
三、while+continue
Four, while nested loop
Five, tag launch control loop
六、while+else
Part 14 of the process control loop for
First, grammar
二、for+break
三、for+continue
continue and break distinction: the former back cycle skip ahead, skip ahead which perform back
Four, for nested loops
五, for + presence
Six, for circulation to achieve loading