# raise

*verb*

say it: **“RAYZ”** **/ˈreɪz/**

The Python keyword that triggers an exception on purpose, usually when a function is given something it can't work with.

## What does `raise` do?

`raise` triggers an exception on purpose, usually when your code receives something it can't work with.

```python
def withdraw(balance, amount):
    if amount > balance:
        raise ValueError("Not enough money in the account")
    return balance - amount
```

## In a sentence

- “withdraw() uses **raise** to stop with a ValueError when the amount is more than the balance.”
- “The test checks that the function will **raise** an error for a negative price.”

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

Updated: November 19, 2026

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