摘要:
一 容器类型的强制转换(str list tuple set dict) var1 = "我爱你,就像老鼠爱大米" var2 = [1,2,3] var3 = ("好","吗","我","他") var4 = {"是","其实","没有"} var5 = {"hjk":"英明神武,瞳孔有力","bj 阅读全文
摘要:
一. 强制类型转换:Number (int float complex bool ) var1 = 3var2 = 5.67var3 = "123"var4 = 5+6jvar5 = "abc"var6 = Truevar7 = False 1.1int的强制转换 可以转换为整型.浮点型.布尔型.纯 阅读全文
摘要:
一 .容器类型(str list tuple set dict) 1.1str(字符串) 转义字符: \+字符 1.把有意义的字符变得无意义 2.把无意义的字符变得有意义 \n ,\r\n 换行 strvar = "怀才就像怀孕,\r\n时间长了才能让人看出来" \t 缩进 strvar = "怀才 阅读全文