I have the function below:
def set_x(self,index1, index2, val):
print('Setting X with index1 : ' + str(index1) + ' , index2 : ' + str(index2) + ' with value : ' + str(val))
print(self.x)
self.x[index1][index2] = val
print(self.x)
print('hehe')
Say for example I called it, with parameters, 0, 1 and 785. The actual ouput is below:
Setting X with index1 : 0 , index2 : 1 with value : 785
[[305, 665], [305, 665]]
[[305, 785], [305, 785]]
Im expecting it to be:
Setting X with index1 : 0 , index2 : 1 with value : 785
[[305, 665], [305, 665]]
[[305,785],[305,665]]
It's like my assignment is setting all the second element of all the array within the array. How will I fix it?