例如生成0到9之间的随机数:
import random
print(random.randint(0,9))
这样会生成0<=随机数<=9的随机数。
python学习笔记——生成随机数
原文:https://www.cnblogs.com/zxc01/p/12683877.html