作用:
定义:
命名规范:
只能由字母、下划线和数字组成,且数字不能开头
python中的标识符是区分大小写的
变量名不能加引号
定义:Python语言中已经占用的具有特殊含义的符号(事先霸占好了)
查看关键字的方法
使用help("keywords")
In [2]: help("keywords")
Here is a list of the Python keywords. Enter any keyword to get more help.
False def if raise
None del import return
True elif in try
and else is while
as except lambda with
assert finally nonlocal yield
break for not
class from or
continue global pass
不能和关键字及已有的名字冲突
命名方法:
大驼峰
XiaoMing
小驼峰
xiaoMing
下划线分隔法
xiao_ming