# Handling Errors with try and except

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.

![Cheat sheet: Handling Errors with try and except](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/1979a08855ae4edc916541876034a35b.webp)

- Category: Python
- Level: Apprentice
- Tags: Exception (python), finally, python, SyntaxError, Traceback, try and except, ValueError
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/python-exceptions-try-except-cheat-sheet
