# Exception

*noun*

say it: **“ek-SEP-shun”** **/ɪkˈsɛpʃən/**

Python's way of reporting an error while a program runs, such as ValueError; if nothing handles it, the program stops and shows a traceback.

## What is an **exception**?

An **exception** is Python's way of reporting an error while the program runs. If nothing handles it, the program stops and shows a traceback.

```python
age = int("twelve")
# ValueError: invalid literal for int() with base 10: 'twelve'
```

## In a sentence

- “The program caught the **exception** and asked for the number again.”
- “int("twelve") raises an **exception**.”

Level: Journeyman · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=3)

Updated: November 19, 2026

## In other subjects

- [Exception in C#](https://www.ask-codey.com/glossary/exception-c-sharp)
- [Exception in Java](https://www.ask-codey.com/glossary/exception-java)

Source: https://www.ask-codey.com/glossary/exception
