I'm using Python 3 and with this code:
import random
mat = [[0]*5]*5
for i in range (0,5) :
for j in range (0,5) :
mat[i][j] = random.randint(10,50)
print (mat)
I'm getting results like this:
[[26, 10, 28, 21, 15], [26, 10, 28, 21, 15], [26, 10, 28, 21, 15], [26, 10, 28, 21, 15], [26, 10, 28, 21, 15]]
The rows are equal each other, but the loop seems to be alright.
What is the problem?