痴漫 发表于 2021-6-16 21:10:55

种子获取

random.getstate()
为什么我计算机出来要报错
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
    x = random.getstate()
NameError: name 'random' is not defined

xiaosi4081 发表于 2021-6-16 21:12:04

本帖最后由 xiaosi4081 于 2021-6-16 21:13 编辑

import random
...
random.getstate()

你是不是没有导入random库

痴漫 发表于 2021-6-16 21:25:00

xiaosi4081 发表于 2021-6-16 21:12
你是不是没有导入random库

这个获取的是什么

xiaosi4081 发表于 2021-6-16 21:26:05

痴漫 发表于 2021-6-16 21:25
这个获取的是什么

https://www.jc2182.com/python/python-random-getstate-method.html
页: [1]
查看完整版本: 种子获取