This is the python code I was trying out
a=[100,203,56,[18]]
b=list(a)
a[3][0]=89
a[1]=23
print(b)
and I got the following output:
[100, 203, 56, [89]]
I am not understanding why only one assignment worked and not the other and secondly I am printing the variable b , how is me changing 'a' affecting 'b'
Additionally, when I write
b[1]=23
instead of
a[1]=23
the output changes and I get
[100, 23, 56, [89]]
edit: despite few answers giving me the solution, I am not able to understand why only one element in the list changes but not the other