[Solved] Python – Replacing Indice Values in Nested Lists


Try this:

nest = [[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]]
x = 1
y = 3
for array in nest:
    for i in range(x, y+1):
        array[i] = 1

print(nest)

I think you would benefit from a basic Python tutorial too, for example try codecademy.com.

3

solved Python – Replacing Indice Values in Nested Lists