Set A Random Seed

[Solved] Set A Random Seed | Go - Code Explorer | yomemimo.com
Question : random set seed

Answered by : kk-sk

# random module is imported
import random
# Any number can be used in place of '0'.
random.seed(0)
# Generated random number will be between 1 to 1000.
print(random.randint(1, 1000))

Source : https://www.geeksforgeeks.org/random-seed-in-python/ | Last Update : Thu, 17 Nov 22

Question : Set a random seed

Answered by : fahad-mattoo

numpy.random.seed(42)

Source : https://stackoverflow.com/questions/5836335/consistently-create-same-random-numpy-array/5837352 | Last Update : Wed, 02 Jun 21

Answers related to set a random seed

Code Explorer Popular Question For Go