I wrote ans = [[0,0],[0,0]]
. Then ans[0][0]
is 0. But me writing ans[0][0] += 1
, it was changed to [[1,0],[1,0]]
. Please tell me why it is.
I wrote like this
ans = [[0,0],[0,0]] ans[0][0] += 1
I supposed it's change to [[1,0],[0,0]]
, because ans[0][0]
is 0.
However it was change to [[1,0],[1,0]]
.
I'd like you to tell me what the correct way to write it is.