When I run
x = [0, 1]
y = [2, 3]
x.append(y)
x[2][1] = 4
print y
it prints out
[2, 4]
So, basically, is it appending the reference of the argument to the list? not a copy that is totally unrelated to the argument?
When I run
x = [0, 1]
y = [2, 3]
x.append(y)
x[2][1] = 4
print y
it prints out
[2, 4]
So, basically, is it appending the reference of the argument to the list? not a copy that is totally unrelated to the argument?