What is the output of the following code ?
>>> s1 = [57, 18 , 3, 23] >>> s2 = s1[:] >>> s2[2] = 67 >>> s1
[57, 18, 3, 23]
[57, 18, 67, 23]
Error
None of the above
In the expression s2 = s1[:] , it assigns a shallow copy of s1 to s2.
So any in place change will not affect s1 and the s1 value will remain same
Comment here: