摘要: import random as r 1.r.random() 用于生成[0, 1)的随机浮点数 print(r.random()) # 0.15966568096223654 2.r.randint(a, b) 用于生成一个[a, b]的随机整数 print(r.randint(5, 9)) # 阅读全文
posted @ 2020-12-12 22:55 博小园 阅读(164) 评论(0) 推荐(0) 编辑
摘要: import math # 先导入math包 1乘方&开方 import math # 乘方开方,可以借助math中的pow函数 print(math.pow(10, 3)) # 10是底数,3是指数 1000.0 print(math.pow(27, 1 / 3)) # 3.0 从上面的结果可以看 阅读全文
posted @ 2020-12-12 22:29 博小园 阅读(147) 评论(0) 推荐(0) 编辑
摘要: python的内置模块sys,提供了系统相关的一些变量和函数,在实际开发中,常见的有以下几种用法 1. 获取操作系统信息 >>> import sys # 在window上执行 >>> sys.platform 'win32' # 在linux上执行 >>> sys.platform 'linux2 阅读全文
posted @ 2020-12-12 22:14 博小园 阅读(558) 评论(0) 推荐(0) 编辑
摘要: Http请求类 package wzh.Http; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; imp 阅读全文
posted @ 2020-12-12 13:48 博小园 阅读(233) 评论(0) 推荐(0) 编辑
回到顶部