Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumPythonshallow vs deep copySingle-choice MCQ

What is printed, and what does it reveal about copy.copy on immutable vs mutable containers?

import copy t = (1, 2, [3]) l = [1, 2] print(copy.copy(t) is t) print(copy.copy(l) is l)