Q:

What will be the output of the following Python code? l=[2, 3, [4, 5]] l2=l.copy() l2[0]=88 l l2

0

What will be the output of the following Python code?

l=[2, 3, [4, 5]] l2=l.copy() l2[0]=88 l l2

 The code shown above depicts deep copy. In deep copy, the base address of the objects is not copied. Hence the modification done on one list does not affect the other list.


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

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Correct Answer:

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

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Python Multiple Choice Questions And Answers

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What will be the output of the following Python co... >>
<< What will be the output of the following Python fu...