python之路-变量

时间:2023-03-09 02:34:18
python之路-变量

变量定义的规则:

  - 变量名只能是字母、数字、或下划线的任意组合

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

  - 以下关键字不能声明为变量名

    ['and','as','assert','break','class','continue','def','del','else','except','exec',finally','for','from',

    'global','if','import','in','is','lambda','not','or','pass','print','raise','return','try','while','with','yield']