[TOC] >[danger] ##### python 变量、常量 ~~~ 1.变量:就是将一些运算的中间结果暂存到内存中,以便后续代码调用。 2.必须由数字,字母,下划线任意组合,且不能数字开头。 3.不能是python中的关键字。 ['and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'with', 'yield'] 4.变量具有可描述性。 5.不能是中文。 6.常量:一直不变的量,变量名全部大写 例如:BIR_OF_CHINA = 1949 ~~~ >[danger] ##### 注释 ~~~ 1.单行注释:# , 2.多行注释:'''被注释内容''' """被注释内容""" ~~~