python-变量

变量定义的规则:

变量名只能是 字母、数字或下划线的任意组合(python3中文也能用,但尽量不要用)

变量名的第一个字符不能是数字

以下关键字不能声明为变量名 ['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']

变量的赋值

第一行:声明变量

第一天的学习笔记,不多就这些。

 

posted @ 2018-03-15 12:50  小夕公子  阅读(135)  评论(0编辑  收藏  举报