# Exceptions in Python

Exceptions in Python: Handling Errors with try and except, Raising Your Own Exceptions.

Updated: November 19, 2026

1. [Handling Errors with try and except](https://www.ask-codey.com/lessons/python-exceptions-try-except) (Apprentice): An exception is Python's report of an error while a program runs, and try and except let a program catch the one it expects, such as the ValueError from turning "two" into a number, with else for what runs when nothing went wrong and finally for what runs every time.
2. [Raising Your Own Exceptions](https://www.ask-codey.com/lessons/python-exceptions-raising-your-own) (Journeyman): A function that's handed a value that makes no sense should refuse it with raise and a message that says what was wrong, can name its own kind of error with a small exception class, and raises rather than returning None when carrying on would give a wrong answer.

Source: https://www.ask-codey.com/courses/python-in-depth/topics/python-exceptions
