Why are context managers useful for resources such as files or network connections?
They keep every resource open until the Python process is killed.
They tie setup and cleanup to a code block so resources are released reliably.
They guarantee that code inside the block can never raise an exception.
They replace all function calls with global variables.