写代码 一定要多用注释 #行注释 ““ ””块注释(可换行)
变量起名规则:1不可数字开头 2不可下划线开头
遵循posix规则: 大驼峰表示类 小驼峰表示非类
python关键词(非变量):
false none true
and as assert
async await break
class continue def
del elif else
except finally for
from global if
import in is
lambda nonlocal not
or pass raise
return try while
with yield
变量类型:
数字Number(二进制0b开头,八进制0o,十六进制0x)
字符Str(需要引号)
列表List(中括号 --> 可更新)
元组tuple(小括号+逗号 --> 不可更新)
集合set(大括号)
字典dist
布尔值 : true/false --> 1/0
数字表示布尔值的话0 == false 其余数字为true
字符串为true 空为false