All practice tasks

Knowledge Check

Context manager evidence

While reviewing Python iterators contexts, a file remains open after an exception. Which action fixes it, and which check proves it worked?

Answer options

  • A. Use a with statement
  • B. Verify cleanup runs on success and failure
  • C. Use an async context manager
  • D. Expose an iterator over rows

What this task practices

Context manager evidence is a knowledge check interview exercise that trains prompt interpretation, explicit assumptions, a concrete response, and a clear explanation of tradeoffs. The catalog marks it as hard difficulty. It focuses on Python Iterators Contexts, Context Manager. The signed-in workspace provides the tools for the round and evaluates the attempt against task-specific criteria. Reference solutions, hidden checks, evaluator instructions, and candidate work remain private.

Sign in to startThe workspace and evaluation open after sign in.