摘要: #列表 列表是python中的基础数据类型之一,其他语言中也有类似于列表的数据类型,比如js中叫数组,他是以[]括起来,每个元素以逗号隔开,而且他里面可以存放各种数据类型比如: li = [‘alex’,123,Ture,(1,2,3,’wusir’),[1,2,3,’小明’,],{‘name’:’ 阅读全文
posted @ 2018-10-23 17:59 Null° 阅读(182) 评论(0) 推荐(0) 编辑
摘要: #bool True False #int > stri = 1s = str(i)#str > ints = '123'i = int(s) #int >bool 只要是0 》False 非0就是Truei = 3b = bool(i)print(b)#bool > int#True 1#Fals 阅读全文
posted @ 2018-10-23 16:24 Null° 阅读(130) 评论(0) 推荐(0) 编辑
摘要: #格式化输出 #逻辑运算 #and or not#优先级,()> not > and > or# print(2 > 1 and 1 < 4)# print(2 > 1 and 1 < 4 or 2 < 3 and 9 > 6 or 2 < 4 and 3 < 2) # print(3>4 or 4 阅读全文
posted @ 2018-10-23 15:17 Null° 阅读(100) 评论(0) 推荐(0) 编辑