变量

为啥用变量?因为繁琐操作
【Python】变量与运算符_赋值使用变量
【Python】变量与运算符_元组_02

变量名

应该有意义
【Python】变量与运算符_值类型_03
规范【Python】变量与运算符_引用类型_04不能用保留字
【Python】变量与运算符_值类型_05
【Python】变量与运算符_值类型_06
区分大小写
【Python】变量与运算符_元组_07没有类型限制,动态的
【Python】变量与运算符_值类型_08

变量赋值动态更新

【Python】变量与运算符_值类型_09

值类型引用类型

值类型int str tuple (不可改变)
引用类型list set dict(可变)

【Python】变量与运算符_值类型_10值类型
【Python】变量与运算符_值类型_11
【Python】变量与运算符_引用类型_12
引用类型list
【Python】变量与运算符_值类型_13
【Python】变量与运算符_元组_14

str不可改变

【Python】变量与运算符_运算符_15

元组和列表的区别

list可改变
【Python】变量与运算符_元组_16tuple不可改变
【Python】变量与运算符_运算符_17追加对比
【Python】变量与运算符_元组_18

建议合作中最好元组,避免元素被更改引发一系列问题

元组中有list则可以修改
【Python】变量与运算符_值类型_19

运算符

【Python】变量与运算符_元组_20
【Python】变量与运算符_元组_21

算数运算符

【Python】变量与运算符_运算符_22

赋值运算符

【Python】变量与运算符_赋值_23

比较运算符

【Python】变量与运算符_元组_24
【Python】变量与运算符_引用类型_25字符串比较,单一拿出比较
【Python】变量与运算符_值类型_26列表,元组比较,每个元素拿出来比较
【Python】变量与运算符_值类型_27

逻辑运算符

【Python】变量与运算符_赋值_28【Python】变量与运算符_引用类型_29【Python】变量与运算符_运算符_30【Python】变量与运算符_值类型_31返回规律不是看位置,而是讲道理
【Python】变量与运算符_运算符_32【Python】变量与运算符_赋值_33

成员运算符

【Python】变量与运算符_引用类型_34字典判断的是k
【Python】变量与运算符_元组_35

身份运算符

【Python】变量与运算符_运算符_36
两个变量相等 is 返回true,和==有什么区别 ?
is比较的不是值相等而是 内存地址
【Python】变量与运算符_运算符_37 集合无序,==不影响。

元组有序,== 会受到位置影响
【Python】变量与运算符_运算符_38

扩展 值 身份id 类型 (对象三特征)

函数判断 类型
【Python】变量与运算符_赋值_39

位运算符

【Python】变量与运算符_值类型_40位与
【Python】变量与运算符_元组_41
【Python】变量与运算符_运算符_42位或
【Python】变量与运算符_引用类型_43【Python】变量与运算符_元组_44