Sail E0 Webinar
Question
What is the output of the code shown below?l1=[1, 2, 3, [4]]l2=list(l1)id(l1)==id(l2)
Options:
A .  True
B .  False
C .  Error
D .  Address of l1
Answer: Option B


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 ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers