变量定义的规则:
1、变量名只能是字母、数字或下划线的任意组合
2、变量名的第一个字符不能是数字
3、以下关键字不能声明为变量名:
["and","as","assert","break","class","continue","def","elif","else","except","exec","finally","for","from","global","if","import","in","ls","lambda","not","or","pass","print","raise","return","try","while","with","yield]
python编码:
python2:声明字符集
# -*- coding:utf-8 -*-
python3:默认UTF-8处理
python注释:
单行注释:使用#号注释
#注释信息
多行注释:使用三个单引号或者三个双引号
'''
注释信息1
注释信息2
...
'''
"""
注释信息1
注释信息2
...
"""