摘要: # import time;# time。time()返回当前时间戳# ticks = time.time();# print("当前的时间戳为:",ticks)# 以“time.struct_time(tm_year=2016, tm_mon=4, tm_mday=7, tm_hour=10, t 阅读全文
posted @ 2019-07-16 11:12 lousang66 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Info = {“k1”: 1, 2:18, “k3”:[11, 22, {“kk1”: (2,55)}], “k4”: (11,33)} “k1”: ”v1” 称为键值对,value可以是任何值,列表、字典不能作为key值,数字、字符串、元组可以,布尔值也可以作为key值(True = 1, Fa 阅读全文
posted @ 2019-07-16 11:10 lousang66 阅读(104) 评论(0) 推荐(0) 编辑
摘要: tu = (11, 222, 44, (2,3), “lousang”, True, [2, 4, (1, 5)], ) 元组是有序的 一级元素不可被修改,不能被增加或删除 嵌套列表元素可以修改:tu[6][2] = 567 结果:tu = (11, 222, 44, (2,3), “lousang 阅读全文
posted @ 2019-07-16 11:08 lousang66 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 列表(list) Li = [1, 2, 4, ”age”, ”alex”, [“lousang”, 2, [“ls”, 19 ,0], 3], True]共有7个元素(通过list类创建的对象) “集合”,里面可以放置任何东西(数字,字符串,列表,布尔值。。。) 列表是有序的,元素可以被修改 1. 阅读全文
posted @ 2019-06-16 15:16 lousang66 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 字符串 str # test = "aLex" # 首字母大写 # v = test.capitalize() # 所有变小/大写,casefold更厉害,可以使很多除英文以外的语言相应变小写 # v1 = test.casefold() # v2 = test.lower()/supper() # 阅读全文
posted @ 2019-06-15 10:47 lousang66 阅读(158) 评论(0) 推荐(0) 编辑