CBSE Class 12 Computer Science Question 21 of 30

Exception Handling — Question 7

Back to all questions
7
Question

Question 7

What does the finally clause produce in a try...except block?

Answer

The 'finally' clause in a 'try-except' block is executed regardless of whether an exception occurs in the 'try' block or not. Its primary purpose is to ensure that certain actions or cleanup operations are performed, before the program exits or moves on to the next code block.