+ 1
Explain this code
why 1st is true and 2nd is false in code below. plz explain in detail https://code.sololearn.com/c13R23AaxtHM/?ref=app
3 Antworten
+ 3
Suppose we have arr = [1,2,3]. Then b = arr just gives an alias for the same object. You can verify this as James did by using the id() operator.
To copy-construct a new object b, you can do b = arr[:] or b = list(arr).
0
so now explain last line of this code
https://code.sololearn.com/c7guBgouUZYW/?ref=app