import random print(random.randint(1,9)) #随机数 每次取出一个 1-9 print(random.choice(['a','b','c'])) #随机取出一个字母 # 更多math库函数请参考:https://docs.python.org/3/librar ...
分类:
编程语言 时间:
2019-12-26 13:25:05
阅读次数:
84
1. math 数学模块 import math ceil:向上取整 floor:向下取整 pow:幂运算 sqrt:开平方运算 fabs:绝对值 fsum:求和 modf:将一个数拆分成整数和小数部分,组成元组 copysign:将第二个参数的正负号拷贝给第一个 pi:圆周率常数 2. pickl ...
分类:
编程语言 时间:
2019-12-25 20:15:05
阅读次数:
119
模块之-random(随机模块) random #shuffle 洗牌功能 >>> i=[1,2,3,4,5,6] >>> random.shuffle(i) >>> random.shuffle(i) >>> i [2, 5, 6, 1, 3, 4] #uniform 就是在random.rand ...
分类:
其他好文 时间:
2019-12-24 09:52:42
阅读次数:
72
ModelForm 使用: 在视图函数类定义一个类,记住一定要继承ModelForm,在这个类中在写另一个原类Meta(规定的 注意首字母大写) Model.py html ...
分类:
其他好文 时间:
2019-12-22 12:36:46
阅读次数:
91
题目如下: Given a square grid of integers arr, a falling path with non-zero shifts is a choice of exactly one element from each row of arr, such that no t ...
分类:
其他好文 时间:
2019-12-15 10:26:34
阅读次数:
108
# random# import random# random.random() # 大于0且小于1之间的小数# random.randint() # 大于等于1且小于等于3之间的整数# random.randrange() # 大于等于1且小于3之间的整数# random.choice([1,'2 ...
分类:
其他好文 时间:
2019-12-13 21:50:27
阅读次数:
95
#更新用户ID数组 def updateUserIDs(): global userIds userIds = [] for i in userList: userIds.append(i['id']) #添加用户 def addUser(): print('当前用户编号:') print(user ...
分类:
编程语言 时间:
2019-12-13 20:06:53
阅读次数:
99
ORM字段 orm常见字段 https://www.cnblogs.com/liuqingzheng/articles/9627915.html choice字段注释与数据渲染 性别 自定义字段 modles基表 modles里面的表有公共字段,可以提取到基表上 基表注意 设置内嵌meta类的abs ...
分类:
其他好文 时间:
2019-12-11 21:35:31
阅读次数:
109
输出 参考: https://www.cnblogs.com/strivepy/p/10436213.html https://www.cnblogs.com/jfl-xx/p/8024596.html https://www.runoob.com/python/func-number-choice ...
分类:
编程语言 时间:
2019-12-06 17:34:38
阅读次数:
402
Django框架 ........ "2.聚合查询 分组 F与Q查询 字段 及其 参数" "数据库的三大范式" "3.orm查询优化 MTV与MVC模型 choice参数 ajax serializers" "mysql取消严格模式" "4.Sweetalert bulk_create批量插入数据 ...
分类:
其他好文 时间:
2019-12-06 14:02:51
阅读次数:
106