English

Define the following: Catching an exception

Advertisements
Advertisements

Question

Define the following:

Catching an exception

Short/Brief Note
Advertisements

Solution

Catching an exception means handling of an exception by exception handlers. An exception is said to be caught when a code that is designed to handle a particular exception is executed. Exceptions, if any, are caught in the try block and handled in the except block.

try:
   statements
except Exception_Name:
   statements for handling exception
shaalaa.com
Handling Exceptions in Python
  Is there an error in this question or solution?
Chapter 1: Exception Handling in Python - Exercise [Page 17]

APPEARS IN

NCERT Computer Science [English] Class 12
Chapter 1 Exception Handling in Python
Exercise | Q 5. c) | Page 17
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×