Python basics-annotation-variable assignment, python assignment
I. Notes
# Note
\ N line Separator
\ Continue the previous row
''' *** ''' Multiline comment
Ii. Basic Rules
: Separate code block (Group) header $ tail
Indent BLOCK statement code blocks are distinguished by indentation depth
Empty rows are used to split functions and classes to facilitate code maintenance and reconstruction.
Each module script file is a module and exists as a disk file. If the module is too large, you can disassemble the code to create another module.
Iii. Variable assignment
= Value assignment
+ = Incremental assignment
X = y = z = 1 multiple values
X, y, z = 1, 2, 'A' multivariate value assignment, and the equal signs on both sides are tuples. Usually the tuples need parentheses. We recommend that you add parentheses [] to increase readability, (x, y, z) = (1, 2, 'A ')
X, y = y, x variable exchange