I was looking at the following code:
from random import choice
for val in range(10):
a = ','.join(str(choice(range(20))) for idx in range(4))
print a
And realized that I hadn't used seed(). I've been taught to seed the random number generator if you intend to generate different psuedo-random sequences.
I decided to run the code, expecting to the sequence repeated each time. But after several runs of the code, it appears to generate a different sequence each time.
- Is it really necessary to seed the Python random number generator? or...
- Is seed being called by default somewhere? or...
- Am I doing something wrong and/or don't understand what's happening?