मराठी

The finally block in Python is executed only if no exception occurs in the try block. - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

The finally block in Python is executed only if no exception occurs in the try block.

पर्याय

  • True

  • False

MCQ
चूक किंवा बरोबर

उत्तर

This statement is False.

Explanation:

In Python, the final block is always executed regardless of whether an error occurs in the try block. It guarantees that cleanup code (such as shutting files or releasing resources) is executed regardless of what happens.

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2024-2025 (March) Board Sample Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×