I have the following code in python:
#-*-coding:cp1252-*-
from random import randint
matriz = [[0] * 5] * 5
print matriz
for i in range(5):
for j in range(5):
numero = randint(0,10)
matriz[i][j] = numero
for i in matriz:
print i
Why the all rows are the same???
by example, a random double list generated:
[0, 5, 1, 0, 10]
[0, 5, 1, 0, 10]
[0, 5, 1, 0, 10]
[0, 5, 1, 0, 10]
[0, 5, 1, 0, 10]
Thanks.