Discussion :: Python MCQs
-
What is the output of the code shown below?l1=[1, 2, 3, [4]]l2=list(l1)id(l1)==id(l2)
Answer : Option B
Explanation :
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.
Be The First To Comment