摘要:
Python 提供的 random 模块实现了各种分布式的伪随机数生成器。 常用函数 random.seed(a) 设置初始化随机因子,可以输出相同随机序列,a 取值整数或浮点数,不设置时默认系统时间作为种子; import random print('不指定种子') for i in range( 阅读全文
摘要:
场景描述 E:/worksp_py/hardwary/100day/twentyfive/itertor.py:4: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collect 阅读全文
摘要:
今天梳理一下Python中交换变量值的方法 借助临时变量 a = 2 b = 4 c = a a = b b = c print(a) # 4 print(b) # 2 不借助临时变量 a = 2 b = 4 a = a + b # 2 + 4 = 6 b = a - b # 6 - 4 = 2 a 阅读全文