主页
Python
Python Random seed() 方法
demo_ref_random_seed
运行 ❯
×
更改方向
保存代码
更改主题
import random random.seed(10) print(random.random()) #the generator creates a random number based on the seed value, so if the seed value is 10, you will always get 0.5714025946899135 as the first random number.
0.5714025946899135