2020年1月28日

摘要: #课程回忆day 17 生成器,迭代器,yield send iter next#列表生成式print([x*2+6 for x in range(10)])#生成器(generator Object)# next send 方法#创建生成器两种方式:# 1.(x*2+6 for x in rang 阅读全文
posted @ 2020-01-28 16:10 三道_python 阅读(185) 评论(0) 推荐(0)
 
摘要: import random print(random.random()) #0.1-1 print(random.randint(1,8)) #1-8 print(random.choice("helloworld")) #h e l l o w o r l d 打散字符串,随机输出一个。 prin 阅读全文
posted @ 2020-01-28 15:36 三道_python 阅读(3383) 评论(0) 推荐(0)
 
摘要: import time # print(time.time()) # time.sleep(3) # print(help(time)) # print(time.gmtime()) # 中国24个时区 北京+8 结构化时间time.struct_time(tm_year=2020, tm_mon= 阅读全文
posted @ 2020-01-28 15:34 三道_python 阅读(171) 评论(0) 推荐(0)