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

A `@contextmanager` generator yields twice. What happens when used in a `with` block?

from contextlib import contextmanager @contextmanager def cm(): yield 1 yield 2 with cm() as v: print(v)