python生成随机数字的方法:可以使用random模块中的randint()函数来生成随机数,如【import random print(random.randint(0,9))】。
代码实现:
(视频教程