S
S
SiezurE2021-10-12 17:04:53
Python
SiezurE, 2021-10-12 17:04:53

Is it possible to somehow insert a variable into random.seed()?

Is there a code, is it possible to do some manipulation with random.seed(), so that its value depends on the variable?

import random
x = 15
random.seed([x])
r1 = random.randint(1000,9999)
print(r1)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ronald McDonald, 2021-10-12
@SiezurE

No, you can't: https://pythonz.net/references/named/random.seed/
You will generally devalue the meaning of this operation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question