Example 1: Handling a Specific Exception In this example, the program attempts to perform a division and handle cases where the user enters an invalid number or tries to divide by zero.
Example 2: Handling Multiple Exceptions In this example, the program attempts to open a file, and different exceptions are caught based on whether the file is not found, there's a permission error, or any other unexpected error occurs.