Question 6 (Advanced):
In Python's context managers, what is the purpose of the
A) Memory allocation and garbage collection
B) Database connection pooling
C) Resource initialization and cleanup
D) Thread synchronization
#Python #ContextManagers #ResourceManagement #Advanced
In Python's context managers, what is the purpose of the
__enter__
and __exit__
methods?A) Memory allocation and garbage collection
B) Database connection pooling
C) Resource initialization and cleanup
D) Thread synchronization
#Python #ContextManagers #ResourceManagement #Advanced