Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumPythoncontextmanagerSingle-choice MCQ

In what order do the resources clean up here?

from contextlib import ExitStack class R: def __init__(self, n): self.n = n def __enter__(self): print("enter", self.n); return self def __exit__(self, *a): print("exit", self.n) with ExitStack() as stack: for i in range(3): stack.enter_context(R(i))