PDA

View Full Version : Random Seeds


Vygreif
04-27-2006, 07:00 PM
Hi,
I want to make a program that uses the same random numbers every time it runs. Will putting random.seed(10) at the beginning of the program and generating random numbers using random.randrange accomplish that?

Thanks,
YG

tobin
04-27-2006, 09:21 PM
It should, but it'd really be easy for you to test this yourself by looking at the output of:

random.seed(10)
for i in range(0,100):
print random()

random.seed(10)
for i in range(0,100):
print random()