Python Developer — Medium
Key points
- Context managers are used to manage resources in Python.
- The __enter__ method sets up the context before the block of code is executed.
- The __exit__ method cleans up resources after the block of code is executed.
- Other options describe different concepts unrelated to context managers.
Ready to go further?
Related questions
