I am a bit confused on what random.seed() does in Python. For example, why does the below trials do what they do (consistently)?
>>> i
Here is a small test that demonstrates that feeding the seed() method with the same argument will cause the same pseudo-random result:
# testing random.seed()
import random
def equalityCheck(l):
state=None
x=l[0]
for i in l:
if i!=x:
state=False
break
else:
state=True
return state
l=[]
for i in range(1000):
random.seed(10)
l.append(random.random())
print "All elements in l are equal?",equalityCheck(l)