Vidyalelo
Python · Q162

Functions in Python

Programming · Python · question 162

Q162

What will be the output of the following Python code? 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, 3, [4, 5]]
Answer
C.
[88, 2, 3, [4, 5]]
[2, 3, [4, 5]]
D.
[2, 3, [4, 5]]
[2, 3, [4, 5]]

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board