Question
What is the output of the code shown below?l1=[1, 2, 3, [4]]l2=list(l1)id(l1)==id(l2)
Answer: Option B
Was this answer helpful ?
The code shown above shows a nested list. A nested list will undergo shallow copy when the list as a whole undergoes deep copy. Hence the output of this code is False.
Was this answer helpful ?
Submit Solution