一、运算符汇总
#1、简单运算符 print(10 + 4) print(10 - 4) print(10 / 3) print(10 // 3) #取整 print(10 * 4) print(10 % 4) # 取余 # 2.比较运算 print(10 > 3) print(10 < 3) print(10 >= 3) print(10 <= 3) print(10 == 3) print(10 != 3) # 3、赋值运算符 # 4、增量赋值 += age = 10 age += 10 print(age) # 5、链式赋值 z = x = y = 10 print(x, y, z) # 6、交叉赋值 m = 10 n = 20 # temp=m # m=n # n=temp #第一种方式(不推荐!) # m,n=n,m #第二种方式 print(m, n) #7、 解压赋值 a, b, c, * _ = salaries = [1.1, 2.2, 3.3, 4.4]#*会将没有对应关系的值存成列表 *一般取两头,不取中间 print(a,b,c) print(_) # mon1=salaries[0] # mon2=salaries[1] # mon3=salaries[2] # mon4=salaries[3] #8、 解压赋值 mon1, mon2, mon3, mon4 = salaries print(mon1) print(mon2) print(mon3) print(mon4) a,b,c= dict ={'a':1,'b':2,'c':3} print(a,b,c)#字典取出来的是key