I have two lists. I want to replace J[0][0] with Leftover[0]. I present the current and expected outputs.
Leftover = [1]
J = [[0, 0, 7, 9, 10]]
for i in range(len(J)):
J[0][Leftover[0]] = 1
print(J)
The current output is
[[0, 1, 7, 9, 10]]
The expected output is
[[1,0,7,9,10]]
J[0][0] = Leftover[0]? and why do you have a loop?