An error (exception) occurs when something goes wrong while your program is running.
Without handling errors, your program will crash.
The try block contains code that might fail.
The except block handles the error.
You can catch specific exceptions for better control.
The else block runs if no error occurs.
The finally block always runs, whether an error occurs or not.
You can handle multiple types of errors separately.
Prompt: Ask the user for a number and divide 100 by it. Handle invalid input and division by zero.
Ask the AI if you need help understanding or want to dive deeper in any topic