adplus-dvertising
frame-decoration

Question

What is the output of the code shown below?
l=[2, 3, [4, 5]]
l2=l.copy()
l2[0]=88
l
l2

a.

[88, 2, 3, [4, 5]]
[88, 2, 3, [4, 5]]

b.

[2, 3, [4, 5]]
[88, 2, 3, [4, 5]]

c.

[88, 2, 3, [4, 5]]
[2, 3, [4, 5]]

d.

[2, 3, [4, 5]]
[2, 3, [4, 5]]

Posted under Python

Answer: (b).[2, 3, [4, 5]]
[88, 2, 3, [4, 5]]

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the code shown below?