Some memories from the first week of Python's full stack development (will be added in succession)
First, some simple commands, concepts
1.print (""): Output
2. Variables
3.input (): Input
4.while loops, if, else statements
5. Data types, data operations (arithmetic operations, comparison operations, assignment operations, logic operations, etc.)
6. List, tuple (tuple)
7. String format output
8. Notes
Second, detailed review
1.print Output Example:
2. Variables:
2.1 Definition: In layman's words, it is to store some temporary data.
2.2 Variable naming rules:
① Do not use Chinese (although feasible)
② naming has a real meaning, that is, do not look at variables, only see the variable name to know what is the use of
③ cannot contain special symbols
The ④ variable name must begin with an underscore and a letter, and cannot begin with a Shuzi number, but a number can be used in the variable name
⑤ is strictly case-sensitive, that is, name and name are a different variable
⑥ avoid the system keyword, do not spoil the keyword content, or the consequences are difficult to eat
⑦ Hump Type
3.input Input:
4. Cycle
While loop example:
While nested loops example:
If_else, elif Example:
Break: Terminates the Loop
Continue: Terminating this cycle
5. Data type, data operation
1.1 Data types
①int shaping: That is, an integer
②float floating Point type: number of decimal points
1.2 Data operations
① arithmetic operations: + 、-、 *,/,//(floor except), * * (Power),% (remainder)
② comparison operations: = =,! =, >, <, >=, <=
③ Assignment operators: =, + =,-=, *=,/=,%=, **=,//=
④ logical operators: And, OR, not: follow short-circuit arithmetic between the three
⑤ member operator: In, not in example:
⑥ identity operator: IS, is not example:
⑦ bitwise operator:& (with), | (or), ^ (XOR), ~ (reverse), >> (Shift right), << (shift left)
With: Both sides of the truth is true
Or: One side is true, that is true
XOR: As long as the two sides are different, true
Inverse: True inversion is false, and vice versa
⑧ the operation precedence of these operators (truncated from Alex Li's blog, Understanding not deep, need to be understood): top to bottom priority reduction, horizontal sibling
Oldboy-homework-week1