I try modifying the list li
with function abc
li = [0, 0]
def abc(x):
li = 8
abc(5)
li
which returns [0, 0]
. On the other hand,
li = [0, 0]
def abc(x):
li[0] = 8
abc(5)
li
returns [8, 0]
. Could you please explain why such micro modification takes effect?