why this happend using model random?

flyaflya flyaflya at gmail.com
Tue May 10 06:02:28 EDT 2005


from random import *

col = [0 for i in range(10)]
a = [col for  i in range(10)]

seed()
for i  in range(10):
     for j in  range(10):
         a[i][j] = randint(0, 100)
print a

the result is:
[[78, 65, 35, 5, 68, 60, 1, 51, 81, 70],
[78, 65, 35, 5, 68, 60, 1, 51, 81, 70],
[78, 65, 35, 5, 68, 60, 1, 51, 81, 70], .....]
why result isn't true random?
but when the code like this:
from random import *
seed()
for i  in range(10):
     for j in  range(10):
         print randint(0, 100)
the result  is true random, what's deffient between these two segment codes?



More information about the Python-list mailing list