import random
n=5
list = [[None]]*n
for i in list:
i[0] = random.uniform(0,1)
print(list)
No matter the value of n, all list entries seem to always end up getting the same value. Why?
(For context, i was trying to fill a matrix with random numbers)
Aucun commentaire:
Enregistrer un commentaire