I have a matrix that will be filled with objects of the same class, I have done this using 2 for loops.
def main(W,H):
field=[[None]*W]*H
for i in range(H):
for j in range(W):
field[i][j]=tile()
# Are the same
print(id(field[0][1]))
print(id(field[1][1]))
print(id(field[2][1]))
print(id(field[3][1]))
# Are diffret
print(id(field[0][0]))
print(id(field[0][1]))
print(id(field[0][2]))
print(id(field[0][3]))
I need all the objects to be different so I can edit and use them separately.