Python - Context Managers
You want to write a context manager that logs when a file is opened and closed. Which method must you implement to ensure the file closes even if an error occurs?
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions