摘要: #_author:LTX#date:2019/11/4import random#(1)print(random.random())#0.5863887824309792 0 1之间的随机数#(2)print(random.choice([1,'qsc','234']))# qsc#(3)print 阅读全文
posted @ 2019-11-04 17:49 Stary_tx 阅读(114) 评论(0) 推荐(0)
摘要: #_author:Administrator#date:2019/11/4#时间模块import time# time - This module provides various functions to manipulate time values.#(1)print(help(time))# 阅读全文
posted @ 2019-11-04 16:56 Stary_tx 阅读(156) 评论(0) 推荐(0)
摘要: #_author:Administrator#date:2019/11/4#可迭代对象list tuple dict stringl=[1,2,3,4]p=iter(l)#为我们返回了一个迭代器对象printprint(p)#<list_iterator object at 0x01A7ED50># 阅读全文
posted @ 2019-11-04 15:38 Stary_tx 阅读(138) 评论(0) 推荐(0)
摘要: A 开始吃包子啦B 开始吃包子啦yuwei开始做包子啦做了两个包子包子[0]来了,被[A]吃了包子[0]来了,被[B]吃了做了两个包子包子[1]来了,被[A]吃了包子[1]来了,被[B]吃了做了两个包子包子[2]来了,被[A]吃了包子[2]来了,被[B]吃了做了两个包子包子[3]来了,被[A]吃了包 阅读全文
posted @ 2019-11-04 14:40 Stary_tx 阅读(170) 评论(0) 推荐(0)
摘要: #_author:生成器#date:2019/11/4def fibo(max): n, before, after = 0, 0, 1 while n<max: yield before# 有暂存功能 before,after=after,before+after n=n+1p=fibo(5)pr 阅读全文
posted @ 2019-11-04 14:36 Stary_tx 阅读(167) 评论(0) 推荐(0)