Python Programming - Functions - Discussion
Discussion Forum : Functions - General Questions (Q.No. 75)
75.
What is the purpose of the
__enter__
and __exit__
methods in a Python class?
Answer: Option
Explanation:
The
__enter__
and __exit__
methods in a Python class are used to create context managers for resource management, allowing proper setup and cleanup.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers