0
someone could explain it? why the output in code playground is one and in IDLE is another?
2 Respuestas
0
That is about low-level stuff.
In code playground your code is sent do sololearn's servers to run there and sends you results.
The difference is between versions- one on sl's servers and another on your computer.
This is problem with how python handles arrays. In version you are using on your computer array store pointers to objects that shoud be there and so if the object is changed all same objects change (to solve that you need to create new array into each index of array:
a = []
for _ in range(4):
a.append([])
# a is now [ [], [], [], [] ]
a[2] = 1
# a is now [ [], [], 1, [] ]
)
The version on sl's servers seems to handle it differently...
0
thanks for the explanation, i thought that all the versions were up to date like in the computer i tested.
btw, i ve done a code to write 3 dimensional arrays following this route
https://code.sololearn.com/cnjw18qZJeAF/?ref=app